Table of Contents

Class Constraints

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

Represents an implementation of IConstraints.

public class Constraints : IConstraints
Inheritance
Constraints
Implements
Inherited Members

Constructors

Constraints(IEventStore, IEnumerable<ICanProvideConstraints>)

Represents an implementation of IConstraints.

public Constraints(IEventStore eventStore, IEnumerable<ICanProvideConstraints> constraintsProviders)

Parameters

eventStore IEventStore

IEventStore for the constraints.

constraintsProviders IEnumerable<ICanProvideConstraints>

Instances of ICanProvideConstraints.

Methods

Discover()

Discover all constraints in the system.

public Task Discover()

Returns

Task

Awaitable task.

GetFor(ConstraintName)

Get a specific constraint by its ConstraintName.

public 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.

public 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.

public Task Register()

Returns

Task

Awaitable task.

ResolveMessageFor(ConstraintViolation)

Resolve the concrete actual message for a ConstraintViolation.

public ConstraintViolation ResolveMessageFor(ConstraintViolation violation)

Parameters

violation ConstraintViolation

ConstraintViolation to resolve for.

Returns

ConstraintViolation

An instance of ConstraintViolation with the resolved message.