Class TenantId

Namespace
Cratis.Arc.Tenancy
Assembly
Cratis.Arc.Core.dll

Represents the concept of a tenant identifier.

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

Constructors

TenantId(TenantId)

protected TenantId(TenantId original)

Parameters

original TenantId

TenantId(string)

Represents the concept of a tenant identifier.

public TenantId(string Value)

Parameters

Value string

The inner value.

Fields

Default

Represents the default tenant.

public static readonly TenantId Default

Field Value

TenantId

Remarks

A host that resolves no tenant and a host that resolves this tenant by name address the same data. Storage that partitions by tenant must therefore treat the two identically — Chronicle names the default namespace "Default" and materializes its read models without a tenant suffix, so a reader that suffixes this tenant resolves a database that does not exist and reads come back empty rather than failing.

NotSet

Represents a tenant ID that is not set.

public static readonly TenantId NotSet

Field Value

TenantId

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

IsDefault

Gets a value indicating whether this is the default tenant — either unset, or the default tenant by name.

public bool IsDefault { get; }

Property Value

bool

Methods

Deconstruct(out string)

public void Deconstruct(out string Value)

Parameters

Value string

Equals(TenantId?)

public virtual bool Equals(TenantId? other)

Parameters

other TenantId

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 ==(TenantId?, TenantId?)

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

Parameters

left TenantId
right TenantId

Returns

bool

implicit operator TenantId(string)

Implicitly convert from a string to a TenantId.

public static implicit operator TenantId(string value)

Parameters

value string

Value to convert from.

Returns

TenantId

operator !=(TenantId?, TenantId?)

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

Parameters

left TenantId
right TenantId

Returns

bool