Interface IGetsFailureMessage<TValidated>
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<in TValidated>
Type Parameters
Name | Description |
---|---|
TValidated | The type of the validated value. |
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.
This interface differs from the non-generic IGets
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 SourceGetFailureMessageAsync(TValidated, ValidationRuleResult, CancellationToken)
Gets the validation failure message for the specified result.
Declaration
ValueTask<string> GetFailureMessageAsync(TValidated value, ValidationRuleResult result, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
TValidated | value | The value under validation. |
Validation |
result | A validation result, typically indicating failure. |
System. |
token | An optional cancellation token. |
Returns
Type | Description |
---|---|
System. |
A human-readable message. |