Class ManifestRule
A model for a single validation rule within a ValidationManifest.
Inheritance
Inherited Members
Namespace: CSF.Validation.Manifest
Assembly: CSF.Validation.Abstractions.dll
Syntax
public class ManifestRule
Remarks
The validation manifest is the model by which validators are described, including how they should validate objects and values.
The validation manifest objects are not particularly suited to serialization, as they support the use of types that cannot be easily serialized. If you are looking for a way to create/define a validator using serialized data then please read the article Using the Manifest Model.
Constructors
| Improve this Doc View SourceManifestRule(ManifestItem, ManifestRuleIdentifier)
Initialises a new instance of ManifestRule.
Declaration
public ManifestRule(ManifestItem manifestValue, ManifestRuleIdentifier identifier)
Parameters
Type | Name | Description |
---|---|---|
ManifestItem | manifestValue | The manifest value for which this rule applies. |
ManifestRuleIdentifier | identifier | The identifier for this rule. |
Properties
| Improve this Doc View SourceDependencyRules
Gets or sets a collection of identifiers upon which the current rule depends.
Declaration
public ICollection<ManifestRuleIdentifier> DependencyRules { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<ManifestRuleIdentifier> |
Remarks
A dependency rule is a rule which must have executed and passed before the current rule may be executed. If the dependency rule does not complete with a Passed outcome, then the current rule will not be executed and will automatically be recorded with a DependencyFailed outcome.
Identifier
Gets the rule's unique identifier.
Declaration
public ManifestRuleIdentifier Identifier { get; }
Property Value
Type | Description |
---|---|
ManifestRuleIdentifier |
Remarks
This value includes the rule's concrete type.
ManifestValue
Gets the manifest value to which this rule applies.
Declaration
public ManifestItem ManifestValue { get; }
Property Value
Type | Description |
---|---|
ManifestItem |
RuleConfiguration
Gets or sets an optional action which is used to configure the rule instance after it has been instantiated.
Declaration
public Action<object> RuleConfiguration { get; set; }
Property Value
Type | Description |
---|---|
System.Action<System.Object> |
Methods
| Improve this Doc View SourceToString()
Gets a string representation of the current instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of the current instance. |