How do Data Annotations work?

后端 未结 4 1277
星月不相逢
星月不相逢 2020-12-08 15:08

I use Data Annotations in my ASP.NET MVC 3 project to validate the model. These are extremely convenient but currently they are magic to me. I read that data annotations do

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 15:33

    because you are not checking if the model is valid... the data notation checks the validity of the model. then you will get your error.

提交回复
热议问题