Show / Hide Table of Contents

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
IAddsFailureMessagesToResult
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 Source

FailureMessageValidationResultPopulator(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 providerFactory is null.

Methods

| Improve this Doc View Source

GetResultWithMessagesAsync<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

Implements

IAddsFailureMessagesToResult
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX