src/Orleans.Core.Abstractions/Core/GrainExtensions.cs
/// <summary>
/// Returns the long representation of a grain primary key.
/// </summary>
/// <param name="grain">The grain to find the primary key for.</param>
/// <param name="keyExt">The output parameter to return the extended key part of the grain primary key, if extended primary key was provided for that grain.</param>
/// <returns>A long representing the primary key for this grain.</returns>
Returns the long representation of a grain primary key.
Returns the long representation of a grain primary key .
public static long GetPrimaryKeyLong(this IAddressable grain, out string keyExt)
        {
            var grainId = GetGrainId(grain);
            if (grainId.TryGetIntegerKey(out var primaryKey, out keyExt))
            {
                return primaryKey;
            }
            if (LegacyGrainId.TryConvertFromGrainId(grainId, out var legacyId))
            {
                return legacyId.GetPrimaryKeyLong(out keyExt);
            }
            throw new InvalidOperationException($"Unable to extract integer key from grain id {grainId}");
        }
public static long GetPrimaryKeyLong ( this IAddressable grain , out string keyExt ) { var grainId = GetGrainId ( grain ) ; if ( grainId . TryGetIntegerKey ( out var primaryKey , out keyExt ) ) { return primaryKey ; } if ( LegacyGrainId . TryConvertFromGrainId ( grainId , out var legacyId ) ) { return legacyId . GetPrimaryKeyLong ( out keyExt ) ; } throw new InvalidOperationException ( $" Unable to extract integer key from grain id  { grainId } " ) ; }
Returns the long representation of a grain primary key.
Returns the long representation of a grain primary key .
A long representing the primary key for this grain.
A long representing the primary key for this grain .
IAddressable
this
<not_specific>
string
out
<not_specific>
grain
<not_specific>
The grain to find the primary key for.
The grain to find the primary key for .
keyExt
<not_specific>
The output parameter to return the extended key part of the grain primary key, if extended primary key was provided for that grain.
The output parameter to return the extended key part of the grain primary key if extended primary key was provided for that grain .