Class ConstraintScope

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

Represents the scope of a constraint, defining optional boundaries for constraint validation.

public record ConstraintScope : IEquatable<ConstraintScope>
Inheritance
ConstraintScope
Implements
Inherited Members
Extension Methods

Constructors

ConstraintScope(ConstraintScope)

protected ConstraintScope(ConstraintScope original)

Parameters

original ConstraintScope

ConstraintScope(EventSourceType?, EventStreamType?, EventStreamId?)

Represents the scope of a constraint, defining optional boundaries for constraint validation.

public ConstraintScope(EventSourceType? EventSourceType = null, EventStreamType? EventStreamType = null, EventStreamId? EventStreamId = null)

Parameters

EventSourceType EventSourceType

Optional EventSourceType to scope the constraint to.

EventStreamType EventStreamType

Optional EventStreamType to scope the constraint to.

EventStreamId EventStreamId

Optional EventStreamId to scope the constraint to.

Fields

None

Represents a constraint scope with no scoping applied.

public static readonly ConstraintScope None

Field Value

ConstraintScope

Properties

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

EventSourceType

Optional EventSourceType to scope the constraint to.

public EventSourceType? EventSourceType { get; init; }

Property Value

EventSourceType

EventStreamId

Optional EventStreamId to scope the constraint to.

public EventStreamId? EventStreamId { get; init; }

Property Value

EventStreamId

EventStreamType

Optional EventStreamType to scope the constraint to.

public EventStreamType? EventStreamType { get; init; }

Property Value

EventStreamType

HasScope

Gets a value indicating whether this scope has any scoping applied.

public bool HasScope { get; }

Property Value

bool

Methods

Deconstruct(out EventSourceType?, out EventStreamType?, out EventStreamId?)

public void Deconstruct(out EventSourceType? EventSourceType, out EventStreamType? EventStreamType, out EventStreamId? EventStreamId)

Parameters

EventSourceType EventSourceType
EventStreamType EventStreamType
EventStreamId EventStreamId

Equals(ConstraintScope?)

public virtual bool Equals(ConstraintScope? other)

Parameters

other ConstraintScope

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ConstraintScope?, ConstraintScope?)

public static bool operator ==(ConstraintScope? left, ConstraintScope? right)

Parameters

left ConstraintScope
right ConstraintScope

Returns

bool

operator !=(ConstraintScope?, ConstraintScope?)

public static bool operator !=(ConstraintScope? left, ConstraintScope? right)

Parameters

left ConstraintScope
right ConstraintScope

Returns

bool