src/Orleans.Core.Abstractions/Core/GrainExtensions.cs
/// <summary>
/// Returns the string primary key of the grain.
/// </summary>
/// <param name="grain">The grain to find the primary key for.</param>
/// <returns>A string representing the primary key for this grain.</returns>
Returns the string primary key of the grain.
Returns the string primary key of the grain .
public static string GetPrimaryKeyString(this IAddressable grain)
        {
            var grainId = GetGrainId(grain);
            if (LegacyGrainId.TryConvertFromGrainId(grainId, out var legacyId))
            {
                return legacyId.GetPrimaryKeyString();
            }
            return grainId.Key.ToStringUtf8();
        }
public static string GetPrimaryKeyString ( this IAddressable grain ) { var grainId = GetGrainId ( grain ) ; if ( LegacyGrainId . TryConvertFromGrainId ( grainId , out var legacyId ) ) { return legacyId . GetPrimaryKeyString ( ) ; } return grainId . Key . ToStringUtf8 ( ) ; }
Returns the string primary key of the grain.
Returns the string primary key of the grain .
A string representing the primary key for this grain.
A string representing the primary key for this grain .
IAddressable
this
grain
The grain to find the primary key for.
The grain to find the primary key for .