Skip to content

LegacyGrainId Methods

Represents an identifier using the legacy Orleans grain identity encoding.

CompareTo(LegacyGrainId?)

View source
public int CompareTo(LegacyGrainId? 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

otherLegacyGrainId?
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.

CreateGrainTypeForGrain(int)

static
View source
public static GrainType CreateGrainTypeForGrain(int typeCode)
Creates the GrainType representation of a legacy grain type code.

Parameters

typeCodeint
The legacy grain type code.

Returns

The corresponding grain type.

CreateGrainTypeForSystemTarget(int)

static
View source
public static GrainType CreateGrainTypeForSystemTarget(int typeCode)
Creates the GrainType representation of a legacy system target type code.

Parameters

typeCodeint
The legacy system target type code.

Returns

The corresponding grain type.

Equals(LegacyGrainId?)

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

Parameters

otherLegacyGrainId?
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? obj)
Determines whether the specified object is equal to the current object.

Parameters

objobject?
The object to compare with the current object.

Returns

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

FromGrainId(GrainId)

static
View source
public static LegacyGrainId FromGrainId(GrainId id)
Converts a GrainId which uses the legacy grain identifier encoding.

Parameters

idGrainId
The grain identifier to convert.

Returns

The converted legacy identifier.

GetHashCode

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

Returns

A hash code for the current object.

GetHashCode_Modulo(uint)

View source
public uint GetHashCode_Modulo(uint umod)
Gets a non-negative hash code reduced modulo the specified value.

Parameters

umoduint
The modulus.

Returns

The hash code in the range from zero through umod minus one.

GetPrimaryKey(string?)

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

Parameters

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

Returns

The GUID primary key.

GetPrimaryKeyLong(string?)

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

Parameters

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

Returns

The integer primary key.

GetUniformHashCode

View source
public uint GetUniformHashCode()
Get a uniformly distributed hash code value for this grain, based on Jenkins Hash function. NOTE: Hash code value may be positive or NEGATIVE.

Returns

Hash code for this LegacyGrainId

IsLegacyGrainType(Type)

static
View source
public static bool IsLegacyGrainType(Type type)
Determines whether a type uses one of the legacy grain key interfaces.

Parameters

typeType
The type to inspect.

Returns

true if the type implements a legacy grain key interface; otherwise, false.

IsLegacyKeyExtGrainType(Type)

static
View source
public static bool IsLegacyKeyExtGrainType(Type type)
Determines whether a type uses a legacy compound grain key interface.

Parameters

typeType
The type to inspect.

Returns

true if the type implements a legacy compound grain key interface; otherwise, false.

NewClientId

static
View source
public static LegacyGrainId NewClientId()
Creates a client identifier with a randomly generated primary key.

Returns

A new legacy client identifier.

NewId

static
View source
public static LegacyGrainId NewId()
Creates a grain identifier with a randomly generated primary key.

Returns

A new legacy grain identifier.

ToString

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

Returns

A string that represents the current object.

TryConvertFromGrainId(GrainId, LegacyGrainId?)

static
View source
public static bool TryConvertFromGrainId(GrainId id, out LegacyGrainId? legacyId)
Attempts to convert a GrainId which uses the legacy grain identifier encoding.

Parameters

idGrainId
The grain identifier to convert.
legacyIdLegacyGrainId?
When this method returns true, contains the converted legacy identifier.

Returns

true if id uses the legacy encoding; otherwise, false.