Is there a way to provide a default MessageTemplateResourceType for the Validator?
I have a class with a lot of string properties that need to be checked. I use the validator app block because I'm a big fan of using attributes to address this need. Everything works great, but my manager is not a fan of the amount of code required to implement message template tokens and resource file.
For instance:
[StringLengthValidator(100,
MessageTemplateResourceName = "InvalidStringLengthMessage",
MessageTemplateResourceType = typeof(Xltech.Common.Resources.XLStrings))]
public string FirstName {get; set;}
The problem is that every argument after 100 (maximum string length) is the same for every StringLengthValidator we have in this class (actually for the whole solution).
Is there a way to at least give the validators a generic MessageTemplateResourceType so that I can reduce the copy / paste involvement?
0
a source to share