Show / Hide Table of Contents

Interface IGetsFailureMessage

An object which can get a human-readable message relating to the failure of a single validation rule.

Namespace: CSF.Validation.Messages
Assembly: CSF.Validation.Abstractions.dll
Syntax
public interface IGetsFailureMessage
Remarks

Such a message is intended to be suitable for display in a user interface, to an appropriate end-user. A good message tells the user what is invalid and indicates what steps should be taken to fix it.

You are encouraged to read more about how validation message providers are used and selected at the documentation relating to message providers.

Methods

| Improve this Doc View Source

GetFailureMessageAsync(ValidationRuleResult, CancellationToken)

Gets the validation failure message for the specified result.

Declaration
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.

See Also

IGetsFailureMessage<TValidated, TParent>
IGetsFailureMessage<TValidated>
IHasFailureMessageUsageCriteria
IHasFailureMessageUsageCriteria<TValidated>
IHasFailureMessageUsageCriteria<TValidated, TParent>
IRuleWithMessage<TValidated>
IRuleWithMessage<TValidated, TParent>
FailureMessageStrategyAttribute
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX