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
originalTenantId
TenantId(string)
Represents the concept of a tenant identifier.
public TenantId(string Value)
Parameters
ValuestringThe inner value.
Fields
Default
Represents the default tenant.
public static readonly TenantId Default
Field Value
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
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
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
Methods
Deconstruct(out string)
public void Deconstruct(out string Value)
Parameters
Valuestring
Equals(TenantId?)
public virtual bool Equals(TenantId? other)
Parameters
otherTenantId
Returns
Equals(ConceptAs<string>?)
public override sealed bool Equals(ConceptAs<string>? other)
Parameters
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Operators
operator ==(TenantId?, TenantId?)
public static bool operator ==(TenantId? left, TenantId? right)
Parameters
Returns
implicit operator TenantId(string)
public static implicit operator TenantId(string value)
Parameters
valuestringValue to convert from.
Returns
operator !=(TenantId?, TenantId?)
public static bool operator !=(TenantId? left, TenantId? right)