ValidateMeta<T>.

WithAssertion(Func<T, bool>, string) Method

Summary

Performs validation checks on metadata.
Assembly
Wyam.Core.dll
Namespace
Wyam.Core.Modules.Metadata
Containing Type
ValidateMeta<T>

Syntax

public ValidateMeta<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
ValidateMeta<T> The current module instance.
GitHub