Show / Hide Table of Contents

Interface IConfiguresRule<TRule>

A builder service which is used to define & configure a single instance of a validation rule.

Namespace: CSF.Validation.ValidatorBuilding
Assembly: CSF.Validation.Abstractions.dll
Syntax
public interface IConfiguresRule<TRule>
Type Parameters
Name Description
TRule

The concrete type of the configured validation rule.

Properties

| Improve this Doc View Source

Dependencies

Gets or sets a collection of the relative identifiers of other validation rules upon which the current rule depends.

Declaration
ICollection<RelativeRuleIdentifier> Dependencies { get; set; }
Property Value
Type Description
System.Collections.Generic.ICollection<RelativeRuleIdentifier>
Remarks

Validation rule dependencies work in two ways:

  • The current rule will not be executed until all of its dependencies have been executed.
  • If any of the current rule's dependencies does not complete with a Passed outcome then the current rule's execution will be skipped and automatically recorded as having a DependencyFailed outcome.

In case it is not obvious, specifying a circular set of validation rule dependencies is not allowed.

| Improve this Doc View Source

Name

Gets or sets an optional rule name. This may be used to differentiate different instances of the same rule (but with different configuration), applied to the same member or validated object.

Declaration
string Name { get; set; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

ConfigureRule(Action<TRule>)

Specifies an action to be executed in order to configure the rule before it is executed.

Declaration
void ConfigureRule(Action<TRule> ruleConfig)
Parameters
Type Name Description
System.Action<TRule> ruleConfig

The rule configuration action.

Extension Methods

RuleBuilderExtensions.AddDependency<T>(IConfiguresRule<T>, Func<IBuildsRelativeRuleIdentifierType, IBuildsRelativeRuleIdentifier>)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX