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

后端 未结 5 1322
粉色の甜心
粉色の甜心 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条回答
  •  Happy的楠姐
    2021-02-01 08:04

    It turns out that AutoMapper may be able to do this for us automagically, which is the best case scenario.

    AutoMapper-users: Transfer validation attributes to the viewmodel?
    http://groups.google.com/group/automapper-users/browse_thread/thread/efa1d551e498311c/db4e7f6c93a77302?lnk=gst&q=validation#db4e7f6c93a77302

    I haven't got around to trying out the proposed solutions there, but intend to shortly.

    (Cross posted this on my (dupe) question as well).

提交回复
热议问题