Table of Contents

Interface IConstraints

Namespace
Cratis.Chronicle.Events.Constraints
Assembly
Cratis.Chronicle.dll

Defines a system to work with constraints.

public interface IConstraints

Methods

Discover()

Discover all constraints in the system.

Task Discover()

Returns

Task

Awaitable task.

GetFor(ConstraintName)

Get a specific constraint by its ConstraintName.

IConstraintDefinition GetFor(ConstraintName constraintName)

Parameters

constraintName ConstraintName

ConstraintName.

Returns

IConstraintDefinition

IConstraintDefinition.

Exceptions

UnknownConstraint

Thrown if the constraint is unknown.

HasFor(ConstraintName)

Check if a constraint exists for a specific ConstraintName.

bool HasFor(ConstraintName constraintName)

Parameters

constraintName ConstraintName

ConstraintName to check for.

Returns

bool

True if it exists, false if not.

Register()

Register all constraints with the Chronicle.

Task Register()

Returns

Task

Awaitable task.

ResolveMessageFor(ConstraintViolation)

Resolve the concrete actual message for a ConstraintViolation.

ConstraintViolation ResolveMessageFor(ConstraintViolation violation)

Parameters

violation ConstraintViolation

ConstraintViolation to resolve for.

Returns

ConstraintViolation

An instance of ConstraintViolation with the resolved message.