Class RuleIdentifierBase
Base model for rule identifiers.
Inherited Members
Namespace: CSF.Validation.Rules
Assembly: CSF.Validation.Abstractions.dll
Syntax
public abstract class RuleIdentifierBase
Constructors
| Improve this Doc View SourceRuleIdentifierBase(Type, Type, String)
Initializes a new instance of RuleIdentifierBase.
Declaration
protected RuleIdentifierBase(Type ruleType, Type validatedType, string ruleName = null)
Parameters
Type | Name | Description |
---|---|---|
System.Type | ruleType | The rule type. |
System.Type | validatedType | The type of value that the rule validates. |
System.String | ruleName | An optional rule name. |
Properties
| Improve this Doc View SourceRuleName
An optional rule name, to uniquely identify this rule where other identifying information might be ambiguous.
Declaration
public string RuleName { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Any rule may have a name, whether it needs one or not. Rules only require a name when the other identifying information would not uniquely identify the rule. That being:
- The rule type: RuleType
- The object identifier (where applicable)
- The member name which provides the value being validated (where applicable)
In these cases where the three pieces of information above are insufficient to uniquely identify a rule, then the rule must be named in order for its identity to be unambiguous. This is most common when the same rule type is applied more than once to the same validated value (but each time with different configuration).
RuleType
The type of the validation rule logic class.
Declaration
public Type RuleType { get; }
Property Value
Type | Description |
---|---|
System.Type |
ValidatedType
Gets the System.Type of value that the rule validates.
Declaration
public Type ValidatedType { get; }
Property Value
Type | Description |
---|---|
System.Type |