Skip to content

UniqueKey Methods

Represents the composite key used by the legacy Orleans grain identifier encoding.

CompareTo(UniqueKey?)

View source
public int CompareTo(UniqueKey? other)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameters

otherUniqueKey?
An object to compare with this instance.

Returns

A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(UniqueKey?)

View source
public bool Equals(UniqueKey? other)
Indicates whether the current object is equal to another object of the same type.

Parameters

otherUniqueKey?
An object to compare with this object.

Returns

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

override
View source
public override bool Equals(object? o)
Determines whether the specified object is equal to the current object.

Parameters

oobject?
The object to compare with the current object.

Returns

true if the specified object is equal to the current object; otherwise, false.

GetHashCode

override
View source
public override int GetHashCode()
Serves as the default hash function.

Returns

A hash code for the current object.

NewGrainServiceKey(short, long)

static
View source
public static UniqueKey NewGrainServiceKey(short key, long typeData)
Creates a grain service key with an integer primary key.

Parameters

keyshort
The primary key.
typeDatalong
The grain service type data.

Returns

A new grain service key.

NewGrainServiceKey(string, long)

static
View source
public static UniqueKey NewGrainServiceKey(string key, long typeData)
Creates a grain service key with a string primary key extension.

Parameters

keystring
The primary key extension.
typeDatalong
The grain service type data.

Returns

A new grain service key.

NewKey

static
View source
public static UniqueKey NewKey()
Creates a key with a randomly generated GUID primary key.

Returns

A new unique key.

NewSystemTargetKey(Guid, long)

static
View source
public static UniqueKey NewSystemTargetKey(Guid guid, long typeData)
Creates a system target key with a GUID primary key.

Parameters

guidGuid
The primary key.
typeDatalong
The system target type data.

Returns

A new system target key.

NewSystemTargetKey(short)

static
View source
public static UniqueKey NewSystemTargetKey(short systemId)
Creates a system target key from a system identifier.

Parameters

systemIdshort
The system identifier.

Returns

A new system target key.

PrimaryKeyToGuid

View source
public Guid PrimaryKeyToGuid()
Gets the GUID primary key of a key without an extension.

Returns

The GUID primary key.

PrimaryKeyToGuid(string?)

View source
public Guid PrimaryKeyToGuid(out string? extendedKey)
Gets the GUID primary key and its optional key extension.

Parameters

extendedKeystring?
When this method returns, contains the key extension, or null if none is present.

Returns

The GUID primary key.

PrimaryKeyToLong

View source
public long PrimaryKeyToLong()
Gets the integer primary key of a key without an extension.

Returns

The integer primary key.

PrimaryKeyToLong(string?)

View source
public long PrimaryKeyToLong(out string? extendedKey)
Gets the integer primary key and its optional key extension.

Parameters

extendedKeystring?
When this method returns, contains the key extension, or null if none is present.

Returns

The integer primary key.

ToString

override
View source
public override string ToString()
Returns a string that represents the current object.

Returns

A string that represents the current object.