Class EffectKey

Namespace
Cratis.Chronicle.Occurrences
Assembly
Cratis.Chronicle.dll

Identifies one effect across every attempt of an occurrence. Pass Value to external idempotent endpoints.

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

Constructors

EffectKey(OccurrenceId, EffectName, LeaseToken)

Identifies one effect across every attempt of an occurrence. Pass Value to external idempotent endpoints.

public EffectKey(OccurrenceId Occurrence, EffectName Name, LeaseToken WrittenBy)

Parameters

Occurrence OccurrenceId

The occurrence identity.

Name EffectName

The stable effect name.

WrittenBy LeaseToken

The attempt writing the receipt; not part of equality.

Properties

Name

The stable effect name.

public EffectName Name { get; init; }

Property Value

EffectName

Occurrence

The occurrence identity.

public OccurrenceId Occurrence { get; init; }

Property Value

OccurrenceId

Value

Gets the opaque, namespace-scoped external idempotency key.

public string Value { get; }

Property Value

string

WrittenBy

The attempt writing the receipt; not part of equality.

public LeaseToken WrittenBy { get; init; }

Property Value

LeaseToken

Methods

Deconstruct(out OccurrenceId, out EffectName, out LeaseToken)

public void Deconstruct(out OccurrenceId Occurrence, out EffectName Name, out LeaseToken WrittenBy)

Parameters

Occurrence OccurrenceId
Name EffectName
WrittenBy LeaseToken

Equals(EffectKey?)

Compares occurrence and name, independently of the writing lease.

public bool Equals(EffectKey? other)

Parameters

other EffectKey

The other effect key.

Returns

bool

Whether both identify the same effect.

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(EffectKey?, EffectKey?)

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

Parameters

left EffectKey
right EffectKey

Returns

bool

operator !=(EffectKey?, EffectKey?)

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

Parameters

left EffectKey
right EffectKey

Returns

bool