Serializing the validation rules

Nov 4, 2011 at 7:29 PM

This fluent validation framework looks very handy.

My only question is if it was a requirement to serialize the validation rules, how would you go about storing them externally and then loading them at runtime?

Coordinator
Nov 5, 2011 at 8:21 PM

Thank you cooplarsh,

Can you provide me more details about your requirement?

Nov 11, 2011 at 2:18 PM

In addition to system-level rules for an entity, we let customers add their own additional validations.  This is useful, for example, when they transfer data to another system which may require a field that isn't required in our system.  So a company could say that InsurancePlanId is required if they are sending HR data to a Benefits Administration Package even though we normally don't require InsurancePlanId.

So I was just wondering if you had a way to store rules in a database such that clients could add their own custom rules, and then load them and add those additional rules to an entity object at runtime or if all the validations had to be expressed in managed code which is compiled into the DLL.