【问题标题】:Data.Annotations with .NET 3.5.NET 3.5 的 Data.Annotations
【发布时间】:2011-04-05 10:46:01
【问题描述】:

我有许多应用了 DataAnnotations 的域类,我需要在我的服务层中验证它们。

我正在使用 WCF、.NET 3.5

如果我使用的是 .NET 4,我可以按如下方式访问验证器

Validator.ValidateObject(@event.Entity, new ValidationContext(@event.Entity, null, null), true); 

3.5 中是否有一个框架可以让我做同样的事情?

【问题讨论】:

    标签: c# .net-3.5 data-annotations


    【解决方案1】:

    我已经使用 http://annotationscontrib.codeplex.com/ 和 3.5 以及 MVC。

    如果不能直接使用,您可以查看源代码以查看属性是如何解析的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-04
      • 2014-08-25
      • 2012-04-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多