I would like to use DataAnnotations in my ASP.NET MVC application. I have strongly typed resources class and would like to define in my view models:
[DisplayName(CTRes.UserName)]
string Username;
CTRes is my resource, automatically generated class. Above definition is not allowed. Are there any other solutions?
Attributes can’t do this
see C# attribute text from resource file?
Resource.ResourceName would be a string property, attribute parameters can only be constants, enums, typeofs