SpecificationCore.

WithMessage<T>(ISpecification<T>, Func<T, 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, 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, string> Custom message factory based on candidate value.

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