Class UniqueEventTypeConstraintsProvider

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

Represents a provider that can provide constraints for unique event types based on event types adorned with UniqueAttribute .

public class UniqueEventTypeConstraintsProvider : ICanProvideConstraints
Inheritance
UniqueEventTypeConstraintsProvider
Implements
Inherited Members
Extension Methods

Remarks

Event types declaring the same constraint name are one constraint, the way Unique<A>(name: x) and Unique<B>(name: x) are on a IConstraintBuilder: it allows at most one event from the declaring event types per event source. Providing them as separate definitions would make each check only its own event type, and leave the name resolving to more than one definition.

Constructors

UniqueEventTypeConstraintsProvider(IClientArtifactsProvider, IEventTypes)

Represents a provider that can provide constraints for unique event types based on event types adorned with UniqueAttribute .

public UniqueEventTypeConstraintsProvider(IClientArtifactsProvider clientArtifactsProvider, IEventTypes eventTypes)

Parameters

clientArtifactsProvider IClientArtifactsProvider

IClientArtifactsProvider for providing client artifacts.

eventTypes IEventTypes

IEventTypes for providing event types.

Remarks

Event types declaring the same constraint name are one constraint, the way Unique<A>(name: x) and Unique<B>(name: x) are on a IConstraintBuilder: it allows at most one event from the declaring event types per event source. Providing them as separate definitions would make each check only its own event type, and leave the name resolving to more than one definition.

Methods

Provide()

Provide constraints.

public IImmutableList<IConstraintDefinition> Provide()

Returns

IImmutableList<IConstraintDefinition>

Collection of Constraint.