The textbox on my Blazor app is being validated using a [RegularExpression] attribute. This attribute needs to be dynamic, in that I need to be able to change the validation string "on the fly". I have working code that can change the string inside the attribute, but when the validation occurs, the new string is reset back to the original string. Debugging the code shows that the attribute's constructor is being called during the validation event which resets back to the original validation string. Does anyone have any ideas on how to remedy this issue? I can provide the code if needed.
TIA
Regarding Yogi's reply about it being readonly, I had forgotten to mention that I used a derived class from ValidationAttribute (not my code), that has an Update method to set the new pattern. The code works - with the debugger I can examine the pattern property to see the new value. I suspect that the <DataAnnotationsValidator/> is re-instantiating the class which is resetting the original pattern value.