I have a Viewmodel with about 30 input properties with decimal regex validation ie:
[RegularExpression(@"\d+(\.\d{1,2})?", ErrorMessage = "Invalid decimal")]
public string strProperty { get; set; }
However I do not want to repeat this for every property. Is there a way to more central and DRY about this.
One idea is to define "\d+(.\d{1,2})?" as a constant.
Thanks....