nspectre - declarative validation for .NET

Generator.CreateSimpleTemplatedSpecification Method 

Creates an instance of a generated class implementing ISpecification.

public string CreateSimpleTemplatedSpecification(
   string template,
   string namespace,
   string name,
   Type target,
   Properties properties,
   string errorMessage,
   string key
);

Parameters

template
The template of the body of the IsSatisfied method.
namespace
The namespace in which the class resides.
name
The name of the class to generate.
target
The type that will be passed into the IsSatisfied method as a candidate.
properties
The properties collection used to process the template.
errorMessage
The error message to use if the candidate does not satisfy the specification.
key
A key to be used by any validation errors which are raised by this specification

Return Value

The name of the type implementing ISpecification.

See Also

Generator Class | NSpectre.Core.Engine Namespace