当使用viewmodels与MVC(MVVM),Model或viewmodel时,验证应该在哪里? (或两者或两者)?为什么?我特别关注了ASP.NET MVC V2的推出。
复杂/自定义验证怎么样?
解决方法
任何业务特定的验证应在模型中。任何网站的具体验证都可以在Model和/或viewmodel中完成。这样,您的业务逻辑(模型)可以移动到不同的界面(Windows,Web窗体等)之后,您的验证将保持原样。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。