src/Orleans.Core.Abstractions/Core/GrainExtensions.cs
/// <summary>
/// Returns whether part of the primary key is of type <see langword="long"/>.
/// </summary>
/// <param name="grain">The target grain.</param>
/// <exception cref="InvalidOperationException">The provided grain does not have a <see cref="long"/>-based key.</exception>
Returns whether part of the primary key is of type .
Returns whether part of the primary key is of type .
public static bool IsPrimaryKeyBasedOnLong(this IAddressable grain)
        {
            var grainId = GetGrainId(grain);
            if (grainId.TryGetIntegerKey(out _))
            {
                return true;
            }
            if (LegacyGrainId.TryConvertFromGrainId(grainId, out var legacyId))
            {
                return legacyId.IsLongKey;
            }
            throw new InvalidOperationException($"Unable to extract integer key from grain id {grainId}");
        }
public static bool IsPrimaryKeyBasedOnLong ( this IAddressable grain ) { var grainId = GetGrainId ( grain ) ; if ( grainId . TryGetIntegerKey ( out _ ) ) { return true ; } if ( LegacyGrainId . TryConvertFromGrainId ( grainId , out var legacyId ) ) { return legacyId . IsLongKey ; } throw new InvalidOperationException ( $" Unable to extract integer key from grain id  { grainId } " ) ; }
Returns whether part of the primary key is of type .
Returns whether part of the primary key is of type .
The provided grain does not have a -based key.
The provided grain does not have a - based key .
IAddressable
this
grain
The target grain.
The target grain .