Table of Contents

Class UniqueConstraintDefinition

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

Represents a definition of a unique event type constraint.

public record UniqueConstraintDefinition : IConstraintDefinition, IEquatable<UniqueConstraintDefinition>
Inheritance
UniqueConstraintDefinition
Implements
Inherited Members

Constructors

UniqueConstraintDefinition(ConstraintName, ConstraintViolationMessageProvider, IEnumerable<UniqueConstraintEventDefinition>, EventTypeId?, bool)

Represents a definition of a unique event type constraint.

public UniqueConstraintDefinition(ConstraintName Name, ConstraintViolationMessageProvider MessageCallback, IEnumerable<UniqueConstraintEventDefinition> EventsWithProperties, EventTypeId? RemovedWith, bool IgnoreCasing)

Parameters

Name ConstraintName

Name of the constraint.

MessageCallback ConstraintViolationMessageProvider

the callback that provides the ConstraintViolationMessage of the constraint.

EventsWithProperties IEnumerable<UniqueConstraintEventDefinition>

The EventType and properties the constraint is for.

RemovedWith EventTypeId

The EventTypeId of the event that removes the constraint.

IgnoreCasing bool

Whether this constraint should ignore casing.

Properties

EventsWithProperties

The EventType and properties the constraint is for.

public IEnumerable<UniqueConstraintEventDefinition> EventsWithProperties { get; init; }

Property Value

IEnumerable<UniqueConstraintEventDefinition>

IgnoreCasing

Whether this constraint should ignore casing.

public bool IgnoreCasing { get; init; }

Property Value

bool

MessageCallback

the callback that provides the ConstraintViolationMessage of the constraint.

public ConstraintViolationMessageProvider MessageCallback { get; init; }

Property Value

ConstraintViolationMessageProvider

Name

Name of the constraint.

public ConstraintName Name { get; init; }

Property Value

ConstraintName

RemovedWith

The EventTypeId of the event that removes the constraint.

public EventTypeId? RemovedWith { get; init; }

Property Value

EventTypeId