Table of Contents

Interface IValidationMessageFormatter<TResource>

Namespace
LfrlAnvil.Validation
Assembly
LfrlAnvil.Validation.dll

Represents a formatter of generic ValidationMessage<TResource> instances.

public interface IValidationMessageFormatter<TResource>

Type Parameters

TResource

Resource type.

Extension Methods

Methods

Format(StringBuilder?, Chain<ValidationMessage<TResource>>, IFormatProvider?)

Formats the provided sequence of messages.

StringBuilder? Format(StringBuilder? builder, Chain<ValidationMessage<TResource>> messages, IFormatProvider? formatProvider = null)

Parameters

builder StringBuilder

Optional StringBuilder instance to append formatted messages to.

messages Chain<ValidationMessage<TResource>>

Sequence of messages to format.

formatProvider IFormatProvider

Optional format provider.

Returns

StringBuilder

Provided builder or a new StringBuilder instance or null when messages are empty.

GetArgs(IFormatProvider?)

Returns a ValidationMessageFormatterArgs instance associated with this message formatter.

[Pure]
ValidationMessageFormatterArgs GetArgs(IFormatProvider? formatProvider)

Parameters

formatProvider IFormatProvider

Optional format provider.

Returns

ValidationMessageFormatterArgs

ValidationMessageFormatterArgs instance associated with this message formatter.

GetResourceTemplate(TResource, IFormatProvider?)

Returns a string representation of the provided resource.

[Pure]
string GetResourceTemplate(TResource resource, IFormatProvider? formatProvider)

Parameters

resource TResource

Resource to get string template for.

formatProvider IFormatProvider

Optional format provider.

Returns

string

string representation of the provided resource.