开发者

Concept of ViewModel/Model Validation in ASP.NET MVC + WCF applicaiton

I have the following architecture of my application: http://clip2net.com/clip/m50879/1303228845-clip-15kb.png

The Model contains a set of POCO objects which should be validated on the web and the services sides. Also, I have additional ViewModel layer which is being used only on the web side. The ViewModel layer contains the most of validation logic开发者_如何学C which is the same as the Model validation logic...

The question is: What is the best approach to avoid copy-paste of the Model validation logic to the ViewModel validation logic?


Maybe this is of interest: "How to: Validate Model Data Using DataAnnotations Attributes" http://msdn.microsoft.com/en-us/library/ee256141(VS.100).aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜