I want to build a const string with a default value from database.
So when I do such:
private const String nifInvalid = MensagensCacheManager.getMensagem(
MensagensCacheManager.GetLanguage(),
"empresa.nif.invalid");
So I have the following error:
'nifInvalid' must be constant
I could use static readonly
but i want to use it for a custom validation message such as:
[RegularExpression(@"(^[0-9]+$)|(\d{8})([-]?)([A-Z]{1})", ErrorMessage=nifInvalid)]
public String nif { set; get; }
How could i build a custom validation and set custom validation message?