SpecificationCore.

WithMessage<T>(ISpecification<T>, Func<T, IReadOnlyDictionary<string, object>, string>) Method

Summary

Creates validation Specification proxy with specific error message factory where not satisfied by.
Namespace
FluentSpecification.Core
Containing Type
SpecificationCore

Syntax

[PublicAPI]
[NotNull]
public static IComplexSpecification<T> WithMessage<T>(this ISpecification<T> self, Func<T, IReadOnlyDictionary<string, object>, string> messageFactory)

Attributes

Type Description
PublicAPI
NotNull

Type Parameters

Name Description
T Type of candidate.

Parameters

Name Type Description
self ISpecification<T> Self specification.
messageFactory Func<T, IReadOnlyDictionary<string, object>, string> Custom message factory based on candidate value and parameters dictionary.

Return Value

Type Description
IComplexSpecification<T> Validation Specification proxy object.

Exceptions

Type Description
System.ArgumentNullException Thrown when self is null.
System.ArgumentNullException Thrown when messageFactory is null.
GitHub