Class SingleRuleExecutor
A service that executes a single validation rule and gets its result.
Inheritance
System.Object
SingleRuleExecutor
Implements
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.RuleExecution
Assembly: CSF.Validation.dll
Syntax
public class SingleRuleExecutor : IExeucutesSingleRule
Constructors
| Improve this Doc View SourceSingleRuleExecutor(IGetsRuleContext)
Initialises a new instance of SingleRuleExecutor.
Declaration
public SingleRuleExecutor(IGetsRuleContext contextFactory)
Parameters
Type | Name | Description |
---|---|---|
IGetsRuleContext | contextFactory | A factory for rule contexts. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Methods
| Improve this Doc View SourceExecuteRuleAsync(ExecutableRule, CancellationToken)
Executes the validation rule and returns its result.
Declaration
public async ValueTask<ValidationRuleResult> ExecuteRuleAsync(ExecutableRule rule, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ExecutableRule | rule | The rule to execute. |
System.Threading.CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<ValidationRuleResult> | A task containing the rule's result. |