I have a custom attribute that accesses the database with nhiberate. The attribute actually inherits from Castle's AbstractValidationAttribute and is used to validate properties against regular expressions. Problem is, these regular expressions are cms managed and stored in the database, and when you change the values in the database, they are not reflected in the attribute. Basically, the attribute only initializes and there fore loads from the database once. Is there any way around this?
Thanks, Robin
In my book it feels a bit odd to have an attribute perform database operations. That said, the attribute object is instantiated each time you call
GetCustomAttributes
for instance, so if the attribute picks up the data as part of its construction, it should fetch it whenever attributes are inspected using that method.