Does ASP.Net MVC 2 validation need some more thought in terms of patterns and use?

后端 未结 5 1277
粉色の甜心
粉色の甜心 2021-02-01 07:09

Here is the lay of the land. Like most people I have my domain object and I have my view models. I love the idea of using view models, as it allows for models to be created spec

5条回答
  •  逝去的感伤
    2021-02-01 07:43

    The DataAnnotation attributes are about validating input and giving UI feedback to the end user. That's really their only intended use. I use different validation strategies for UI objects and business objects, so the DA validation attributes only end up on models being shown to the user.

提交回复
热议问题