Class FailureMessageValidationResultPopulator
A service which converts a ValidationResult into a ValidationResult by getting messages for each rule result within the original result and adding a message, where appropriate.
Inheritance
System.Object
FailureMessageValidationResultPopulator
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.Messages
Assembly: CSF.Validation.dll
Syntax
public class FailureMessageValidationResultPopulator : IAddsFailureMessagesToResult
Constructors
| Improve this Doc View SourceFailureMessageValidationResultPopulator(IGetsRuleWithMessageProvider)
Initialises a new instance of FailureMessageValidationResultPopulator.
Declaration
public FailureMessageValidationResultPopulator(IGetsRuleWithMessageProvider providerFactory)
Parameters
Type | Name | Description |
---|---|---|
IGetsRuleWithMessageProvider | providerFactory | A rule/message provider factory. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Methods
| Improve this Doc View SourceGetResultWithMessagesAsync<TValidated>(IQueryableValidationResult<TValidated>, ResolvedValidationOptions, CancellationToken)
Gets a copy of the result
but with human-readable feedback feedback messages
added to the individual rule-results where applicable.
Declaration
public async Task<IQueryableValidationResult<TValidated>> GetResultWithMessagesAsync<TValidated>(IQueryableValidationResult<TValidated> result, ResolvedValidationOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IQueryableValidationResult<TValidated> | result | The validation result. |
ResolvedValidationOptions | options | Validation options. |
System.Threading.CancellationToken | cancellationToken | An optional token which may be used to cancel the process prematurely. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IQueryableValidationResult<TValidated>> | A task which exposes a copy of the validation result, but with additional feedback messages. |
Type Parameters
Name | Description |
---|---|
TValidated |