I've the following Attributes defined on my Name field:
[Required(ErrorMessageResourceName = "ValidationErrorRequiredField", ErrorMessageResourceType = typeof(MyResources))]
[Display(Order = 0, Name = ResXStrings.UserName, ResourceType = typeof(MyResources))]
public string Name { get; set; }
I want to create a custom Attribute which looks like this:
[MyAttribute(DisplayName = "Username", ErrorMessage = "ValidationErrorRequiredField", ResourceType = typeof(MyResources))]
public string Name { get; set; }
which defines in code the other two (Required and Display) attributes.
How to implement this ?
UPDATE It's not possible. Thanks to all people who helped answering my question.