开发者

ASP.NET MVC 2 DataAnnotation based Validation conflict with LINQ2SQL

ASP.NET MVC 2, gives a good functionality of annotation based validation, but to use this functionality I need to reference two files (Microsoft.Web.Mvc.ModelBinders.dll and System.ComponentModel.DataAnnotations.dll) as described here

I use LINQ2SQL, to create my entities. And it uses it's own annotations within Entity classes, which needs another version of System.ComponentModel.DataAnnotations.dll

So currently I'm a开发者_运维知识库ble to use one of them (either validation or linq2sql) Does anyone encountered same problem? Or does anyone know how to solve this problem?


What you need to do is create MetaData classes for the fields that you want to valdiate,

http://www.asp.net/learn/mvc/tutorial-39-cs.aspx (Using Data Annotation Validators with the Entity Framework)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜