Show / Hide Table of Contents

Class FailureMessageProviderAdapter<TValidated>

Adapter which allows a IGetsFailureMessage<TValidated> to be used as a IGetsFailureMessage.

Inheritance
System.Object
FailureMessageProviderAdapter<TValidated>
Implements
IGetsFailureMessage
IHasWrappedFailureMessageProvider
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 FailureMessageProviderAdapter<TValidated> : IGetsFailureMessage, IHasWrappedFailureMessageProvider
Type Parameters
Name Description
TValidated

The validated type.

Constructors

| Improve this Doc View Source

FailureMessageProviderAdapter(IGetsFailureMessage<TValidated>)

Initialises a new instance of FailureMessageProviderAdapter<TValidated>.

Declaration
public FailureMessageProviderAdapter(IGetsFailureMessage<TValidated> wrapped)
Parameters
Type Name Description
IGetsFailureMessage<TValidated> wrapped

The wrapped service.

Exceptions
Type Condition
System.ArgumentNullException

If wrapped is null.

Methods

| Improve this Doc View Source

GetFailureMessageAsync(ValidationRuleResult, CancellationToken)

Gets the validation failure message for the specified result.

Declaration
public ValueTask<string> GetFailureMessageAsync(ValidationRuleResult result, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
ValidationRuleResult result

A validation result, typically indicating failure.

System.Threading.CancellationToken token

An optional cancellation token.

Returns
Type Description
System.Threading.Tasks.ValueTask<System.String>

A human-readable message.

| Improve this Doc View Source

GetWrappedProvider()

Gets a reference to the wrapped failure message provider instance.

Declaration
public object GetWrappedProvider()
Returns
Type Description
System.Object

The wrapped failure message provider.

Implements

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