Add software data annotations

I am working on an asp mvc3 application using .NET 4 .

However, the model I want to use is in the class library, which uses .NET 3.5 and cannot change.

Can I add .NET 4 data annotations to some properties of my model in the controller programmatically to get an easy check?

+5
source share
2 answers

Create your own ModelMetadataProvider and it should want what you want

http://www.dotnetcurry.com/ShowArticle.aspx?ID=715

+3
source

, , .NET 4 MetadataTypeAttribute, sibling, , .

, ASP.NET MVC ( Silverlight). System.ComponentModel.DataAnnotations Entity Framework 4.0

+2

All Articles