Class ResultsForErroredValuesExecutionDecorator
A decorator for IExecutesAllRules which adds additional results to the output for any validated values which raised an error when they were retrieved.
Inheritance
Implements
Inherited Members
Namespace: CSF.Validation.RuleExecution
Assembly: CSF.Validation.dll
Syntax
public class ResultsForErroredValuesExecutionDecorator : IExecutesAllRules
Remarks
This decorator is relevant when the ValueResponse for any of the ValidatedValue of any of the available rules is an instance of ErrorGetValueToBeValidatedResponse. These value responses represent values which were not successfully retrieved & threw an exception.
This class adds additional result items to the overall list of results, to indicate that these validated values caused errors.
This would only occur if the AccessorExceptionBehaviour is set to TreatAsError.
Constructors
| Improve this Doc View SourceResultsForErroredValuesExecutionDecorator(IExecutesAllRules)
Initialises a new instance of ResultsForErroredValuesExecutionDecorator.
Declaration
public ResultsForErroredValuesExecutionDecorator(IExecutesAllRules wrapped)
Parameters
Type | Name | Description |
---|---|---|
IExecutesAllRules | wrapped | The wrapped rule executor. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Methods
| Improve this Doc View SourceExecuteAllRulesAsync(IRuleExecutionContext, CancellationToken)
Execute all of the specified validation rules and return their results.
Declaration
public async Task<IReadOnlyCollection<ValidationRuleResult>> ExecuteAllRulesAsync(IRuleExecutionContext executionContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IRuleExecutionContext | executionContext | The validation rule execution context. |
System.Threading.CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<ValidationRuleResult>> | A task containing a collection of the results from the executed validation rules. |