WithAssertion(Func<T, bool>, string) Method
Performs validation checks on metadata.
Namespace
Statiq.Core
Containing Type
ValidateMetadata<T>

Syntax

public ValidateMetadata<T> WithAssertion(Func<T, bool> execute, string message = null)

Parameters

Name Type Description
execute Func<T, bool> The assertion function, of type Func<T, bool> where T is the generic parameter of the ValidateMeta declaration. Assertions are strongly-typed and can assume the value has been converted to the correct type. If the function returns false, the check failed, an exception will be thrown, and execution will halt.
message string The error message to output on failure.

Return Value

Type Description
ValidateMetadata<T> The current module instance.