Class Subject

Namespace
Cratis.Chronicle
Assembly
Cratis.Chronicle.dll

Represents the subject an event or read model is about — the target used as the identity for compliance concerns such as PII encryption keys. When omitted on append, the EventSourceId is used as the subject.

public record Subject : ConceptAs<string>, IComparable<ConceptAs<string>>, IComparable<string>, IComparable, IEquatable<ConceptAs<string>>, IEquatable<Subject>
Inheritance
Subject
Implements
Inherited Members
Extension Methods

Constructors

Subject(Subject)

protected Subject(Subject original)

Parameters

original Subject

Subject(string)

Represents the subject an event or read model is about — the target used as the identity for compliance concerns such as PII encryption keys. When omitted on append, the EventSourceId is used as the subject.

public Subject(string Value)

Parameters

Value string

Actual value.

Fields

NotSet

Gets the representation of a Subject that has not been set.

public static readonly Subject NotSet

Field Value

Subject

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

IsSet

Gets a value indicating whether the Subject has been set.

public bool IsSet { get; }

Property Value

bool

Methods

Deconstruct(out string)

public void Deconstruct(out string Value)

Parameters

Value string

Equals(Subject?)

public virtual bool Equals(Subject? other)

Parameters

other Subject

Returns

bool

Equals(ConceptAs<string>?)

public override sealed bool Equals(ConceptAs<string>? other)

Parameters

other ConceptAs<string>

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 override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(Subject?, Subject?)

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

Parameters

left Subject
right Subject

Returns

bool

implicit operator Subject(EventSourceId)

Implicitly convert from EventSourceId to Subject.

public static implicit operator Subject(EventSourceId eventSourceId)

Parameters

eventSourceId EventSourceId

EventSourceId to convert from.

Returns

Subject

A converted Subject.

implicit operator Subject(Guid)

Implicitly convert from Guid to Subject.

public static implicit operator Subject(Guid id)

Parameters

id Guid

Guid to convert from.

Returns

Subject

A converted Subject.

implicit operator Subject(string)

Implicitly convert from string to Subject.

public static implicit operator Subject(string value)

Parameters

value string

string to convert from.

Returns

Subject

A converted Subject.

operator !=(Subject?, Subject?)

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

Parameters

left Subject
right Subject

Returns

bool