Class ValidationRuleActivator
Contains methods for creating ValidationRules.
public class ValidationRuleActivator : IValidationRuleActivator
- Inheritance
-
objectValidationRuleActivator
- Implements
- Extension Methods
Constructors
ValidationRuleActivator(IValidationRuleDefinitionProvider)
Initializes a new instance of the ValidationRuleActivator class.
public ValidationRuleActivator(IValidationRuleDefinitionProvider validationRuleDefinitionProvider)
Parameters
validationRuleDefinitionProvider
IValidationRuleDefinitionProviderRetrieves ValidationRuleDefinitions.
Methods
CreateValidationRule(ValidationRuleDefinition)
Creates a new instance of the ValidationRule specified by its definition with default property values.
public ValidationRule CreateValidationRule(ValidationRuleDefinition definition)
Parameters
definition
ValidationRuleDefinitionDefines ValidationRule which is to be created.
Returns
- ValidationRule
Returns an instance of ValidationRule as described by its definition.
Exceptions
- ArgumentNullException
Thrown when
definition
is null.
CreateValidationRule(string)
Creates a new instance of the ValidationRule specified by its definition with default property values.
public ValidationRule CreateValidationRule(string validationRuleIdentifier)
Parameters
validationRuleIdentifier
stringIdentifies ValidationRule which is to be created.
Returns
- ValidationRule
Returns an instance of ValidationRule as described by its definition.
Exceptions
- ArgumentNullException
Thrown when
validationRuleIdentifier
is null or empty.- InvalidOperationException
Thrown when ValidationRule with given
validationRuleIdentifier
is not registered in the system.