src/Orleans.Core.Abstractions/IDs/GrainIdKeyExtensions.cs
/// <summary>
/// Tries to parse the <see cref="GrainId.Key"/> portion of the provided grain id to extract a <see cref="long"/> key and <see cref="string"/> key extension.
/// </summary>
/// <param name="grainId">
/// The grain id.
/// </param>
/// <param name="key">
/// The key.
/// </param>
/// <param name="keyExt">
/// The key extension.
/// </param>
/// <returns>
/// <see langword="true"/> when the grain id was successfully parsed, <see langword="false" /> otherwise.
/// </returns>
Tries to parse the  portion of the provided grain id to extract a  key and  key extension.
Tries to parse the portion of the provided grain id to extract a key and key extension .
public static bool TryGetIntegerKey(this GrainId grainId, out long key, [NotNullWhen(true)] out string keyExt)
        {
            keyExt = null;
            var keyString = grainId.Key.AsSpan();
            if (keyString.IndexOf((byte)'+') is int index && index >= 0)
            {
                keyExt = keyString.Slice(index + 1).GetUtf8String();
                keyString = keyString.Slice(0, index);
            }
            return Utf8Parser.TryParse(keyString, out key, out var len, 'X') && len == keyString.Length;
        }
public static bool TryGetIntegerKey ( this GrainId grainId , out long key , [ NotNullWhen ( true ) ] out string keyExt ) { keyExt = null ; var keyString = grainId . Key . AsSpan ( ) ; if ( keyString . IndexOf ( ( byte ) ' ' ) is int index && index >= 0 ) { keyExt = keyString . Slice ( index + 1 ) . GetUtf8String ( ) ; keyString = keyString . Slice ( 0 , index ) ; } return Utf8Parser . TryParse ( keyString , out key , out var len , ' ' ) && len == keyString . Length ; }
Tries to parse the  portion of the provided grain id to extract a  key and  key extension.
Tries to parse the portion of the provided grain id to extract a key and key extension .
when the grain id was successfully parsed,  otherwise.
when the grain id was successfully parsed otherwise .
GrainId
this
long
out
out
[NotNullWhen(true)]
grainId
The grain id.
The grain id .
key
None
keyExt
The key extension.
The key extension .