You can implement a custom rule attribute by inheriting from the RulePropertyValue<TPropertyValue> class. Here, such a rule is created to check the length of the specified string property. The rule is applied using a specially designed custom rule attribute in code or in the Application Model. The following properties are checked: - MoreThan5Symbols must consist of more than five symbols; - NotMoreThanTenSymbols value length must not exceed 10; This rule is checked when saving an object.
|