You have validation attributes on the properties of your entity but your code is assuming that those attributes will never be violated. You need to check ModelState.IsValid to see whether the data entered by the user passes validation and only save it if it does. If it doesn't you need to redisplay the Create view with the validation errors so that the user can correct them.