title: Custom errormessages using database for dataannotations in MVC 3
body: <p>I'm trying to implement a custom class for dataannotations that retrieves error messages from a database. The database part is all done using EF and LINQ to return the messages.</p>
  
  <pre><code>[Required(ErrorMessageResourceType=typeof(MyTestClass), ErrorMessageResourceName="Required")]
  </code></pre>
  
  <p>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.</p>
  
  <p>I'm really stuck on this one, so I'd appreciate some code to solve this issue.</p>
  
  <p>/Lasse</p>