Class Causation

Namespace
Cratis.Chronicle.Auditing
Assembly
Cratis.Chronicle.dll

Represents a causation instance.

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

Constructors

Causation(Causation)

protected Causation(Causation original)

Parameters

original Causation

Causation(DateTimeOffset, CausationType, IDictionary<string, string>)

Represents a causation instance.

public Causation(DateTimeOffset Occurred, CausationType Type, IDictionary<string, string> Properties)

Parameters

Occurred DateTimeOffset

When it occurred.

Type CausationType

Type of causation.

Properties IDictionary<string, string>

Any properties associated with the causation.

Properties

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Occurred

When it occurred.

public DateTimeOffset Occurred { get; init; }

Property Value

DateTimeOffset

Properties

Any properties associated with the causation.

public IDictionary<string, string> Properties { get; init; }

Property Value

IDictionary<string, string>

Type

Type of causation.

public CausationType Type { get; init; }

Property Value

CausationType

Methods

Deconstruct(out DateTimeOffset, out CausationType, out IDictionary<string, string>)

public void Deconstruct(out DateTimeOffset Occurred, out CausationType Type, out IDictionary<string, string> Properties)

Parameters

Occurred DateTimeOffset
Type CausationType
Properties IDictionary<string, string>

Equals(Causation?)

public virtual bool Equals(Causation? other)

Parameters

other Causation

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

Unknown()

Creates an unknown causation instance.

public static Causation Unknown()

Returns

Causation

A new instance of Causation with the current time, type set to Unknown, and an empty properties dictionary.

Operators

operator ==(Causation?, Causation?)

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

Parameters

left Causation
right Causation

Returns

bool

operator !=(Causation?, Causation?)

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

Parameters

left Causation
right Causation

Returns

bool