FdbTenantName
Namespace: FoundationDB.Client · struct
Implements: IEquatable<FdbTenantName>, IComparable<FdbTenantName>
Represents the name of a Tenant in the database
Remarks
A tenant is represented by a binary name, that is mapped into a common key prefix by the database cluster
Example
var name1 = FdbTenantName.Create(Slice.FromStringUtf8("HelloWorld"));
var name2 = FdbTenantName.FromParts("AnotherApp", "Contoso", 456));
var name3 = FdbTenantName.FromTuple(("MyAwesomeApp", "ACME", 123));
Properties
IsValid
bool IsValid { get; }
Test if this name is a valid tenant name
Returns: true if the name is not empty and does not start with \xFF
Methods
CompareTo
int CompareTo(FdbTenantName other)
Copy
static FdbTenantName Copy(FdbTenantName name)
Create a copy of a tenant name
Returns: Name that contains the same bytes as the original
Create
static FdbTenantName Create(Slice name)
Create a tenant name from an opaque sequence of bytes
static FdbTenantName Create(ReadOnlyMemory<byte> name)
Create a tenant name from an opaque sequence of bytes
static FdbTenantName Create(ReadOnlySpan<byte> name)
Create a tenant name from an opaque sequence of bytes
EnsureIsValidName
static Slice EnsureIsValidName(ReadOnlySpan<byte> name, string paramName = null)
static Slice EnsureIsValidName(Slice name, string paramName = null)
Equals
bool Equals(FdbTenantName other)
bool Equals(object obj)
FromParts
static FdbTenantName FromParts<T1>(T1 item1)
Create a tenant name from a 1-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromParts<T1, T2>(T1 item1, T2 item2)
Create a tenant name from a 2-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromParts<T1, T2, T3>(T1 item1, T2 item2, T3 item3)
Create a tenant name from a 3-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromParts<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4)
Create a tenant name from a 4-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromParts<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)
Create a tenant name from a 5-tuple
The tuple is packed to generate the actual name
FromTuple
static FdbTenantName FromTuple<TTuple>(in TTuple items)
Create a tenant name from an N-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromTuple<T1>((T1) items)
Create a tenant name from an N-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromTuple<T1, T2>((T1, T2) items)
Create a tenant name from an N-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromTuple<T1, T2, T3>((T1, T2, T3) items)
Create a tenant name from an N-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromTuple<T1, T2, T3, T4>((T1, T2, T3, T4) items)
Create a tenant name from an N-tuple
The tuple is packed to generate the actual name
static FdbTenantName FromTuple<T1, T2, T3, T4, T5>((T1, T2, T3, T4, T5) items)
Create a tenant name from an N-tuple
The tuple is packed to generate the actual name
GetHashCode
int GetHashCode()
IsValidName
static bool IsValidName(ReadOnlySpan<byte> name)
Test if a tenant name is valid
Returns: true if the name is not empty and does not start with \xFF
ToSlice
Slice ToSlice()
Return a copy of the binary representation of the name
ToString
string ToString()
Return a hyman-readable name for this tenant name
TryGetTuple
bool TryGetTuple(out IVarTuple tuple)
Try decoding the name as a Tuple
tuple— Receives the decoded tuple, if the method returnstrue
Returns: Returns true if the name is a valid tuple encoding; otherwise, false
Fields
None
static readonly FdbTenantName None