I'm working on some code which use DataAnnotation attributes on viewmodels, and overrides some of the attributes programmatically under certain circumstances.
Changing ErrorMessage
on various types of ValidationAttributes
, no problem.
Changing DataFormatString
on DisplayFormatAttributes
, no problem.
Changing MinimumLength
on a StringLengthAttribute
, no problem. But.. MaximumLength
does not have a public setter!?
Is there any reason why this one property stands out as having a private setter, when all around it are public? Is there any workaround I can use to programmatically change the maximum length of a StringLengthAttribute
?