nspectre - declarative validation for .NET

Generator.CreateAntiSpecification Method 

Creates a specification that returns the opposite of the specified specification.

public string CreateAntiSpecification(
   string specification,
   string namespace,
   string name,
   Type target,
   string errorMessage,
   string key
);

Parameters

specification
The name of the type implementing ISpecification to use.
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.
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.

Remarks

The specification parameter to use will usually be the output of the CreateSimpleTemplatedSpecification method.

See Also

Generator Class | NSpectre.Core.Engine Namespace