Show / Hide Table of Contents

Class RelativeRuleIdentifier

A model for information which may uniquely identity a validation rule, based upon the logical 'position' (within a validator) of another rule. In other words, it uniquely identifies a rule, based upon a current rule.

Inheritance
System.Object
RelativeRuleIdentifier
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CSF.Validation.ValidatorBuilding
Assembly: CSF.Validation.Abstractions.dll
Syntax
public class RelativeRuleIdentifier

Constructors

| Improve this Doc View Source

RelativeRuleIdentifier(Type, String, String, Int32)

Initializes a new instance of RelativeRuleIdentifier.

Declaration
public RelativeRuleIdentifier(Type ruleType, string memberName = null, string ruleName = null, int ancestorLevels = 0)
Parameters
Type Name Description
System.Type ruleType

The rule type.

System.String memberName

An optional member name.

System.String ruleName

An optional rule name.

System.Int32 ancestorLevels

An optional number of ancestor levels.

Exceptions
Type Condition
System.ArgumentNullException

If ruleType is null.

System.ArgumentOutOfRangeException

If ancestorLevels is less than zero.

Properties

| Improve this Doc View Source

AncestorLevels

Gets the number of levels of ancestry (within the parent/child validation hierarchy) which must be traversed from the 'current' rule, in order to reach the validator which contains the identified rule.

Declaration
public int AncestorLevels { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

MemberName

Where the referenced rule is for a member of a value/object, this property gets the member name.

Declaration
public string MemberName { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

RuleName

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).

| Improve this Doc View Source

RuleType

The type of the validation rule logic class.

Declaration
public Type RuleType { get; }
Property Value
Type Description
System.Type
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX