I'm trying to implement a c开发者_如何学JAVAustom class for dataannotations that retrieves error messages from a database. The database part is all done using EF and LINQ to return the messages.
[Required(ErrorMessageResourceType=typeof(MyTestClass), ErrorMessageResourceName="Required")]
What does my class need to return for it to work? Works with resource-file, but I really need to put it in database. And it should work for StringLength and other validation attributes.
I'm really stuck on this one, so I'd appreciate some code to solve this issue.
/Lasse
http://blog.gauffin.org/2010/11/simplified-localization-for-dataannotations/
精彩评论