Server-side validation of a REQUIRED String Property in MVC2 Entity Framework 4 does not work

前端 未结 3 1402
伪装坚强ぢ
伪装坚强ぢ 2020-12-14 10:37

I\'m trying to get server-side validation of an Entity Framework String Property to work. Other server-side validation such as data type validation and required dateTime and

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 11:05

    Sometimes in database first approach in EF, may you update your column from not null to can be null using SQL query and use 'Update Model From Database...' (in EDMX right click) then maybe property of that entity not updated properly and so if you have some null data in that column ,in mapping ,violation occurs and this error shown.

    To fix this; You can check the Nullable in Properties of that property of entity that you updated it.

提交回复
热议问题