Validation Rules
- 2 minutes to read
XAF provides several built-in types of Validation Rules. They are defined in the following table:
Validation Rule type | Description |
---|---|
RuleCombinationOfPropertiesIsUnique (RuleCombinationOfPropertiesIsUniqueAttribute) | Demands that the combination of particular property values should be unique. |
RuleCriteria (RuleCriteriaAttribute) | Demands that an object of a particular type should satisfy a specified criteria. |
RuleFromBoolProperty (RuleFromBoolPropertyAttribute) | Demands that a Boolean type property should have a True value. |
RuleIsReferenced (RuleIsReferencedAttribute) | Demands that an object should be referenced in objects of a specified type. |
RuleObjectExists (RuleObjectExistsAttribute) | Demands that an object of a particular type that satisfies specified criteria exists in the database. |
RuleRange (RuleRangeAttribute) | Demands that a particular property’s value should be within a specified value range. |
RuleRegularExpression (RuleRegularExpressionAttribute) | Demands that a particular property should match a specified pattern. |
RuleRequiredField (RuleRequiredFieldAttribute) | Demands that a property should have a value. |
RuleStringComparison (RuleStringComparisonAttribute) | Demands that the value of a particular String type property should satisfy a specified condition. |
RuleValueComparison (RuleValueComparisonAttribute) | Demands that a particular property’s value should satisfy a specified condition. |
RuleUniqueValue (RuleUniqueValueAttribute) | Demands that a particular property’s value should be unique. |
All of these Validation Rule types implement the IRule interface. You can develop your own Rules by implementing the IRule interface, or by inheriting from the RuleBase abstract class, which implements this interface. For details, refer to the Implement Custom Rules topic.
See Also