src/Orleans.Serialization/Session/ReferencedObjectCollection.cs
/// <summary>
/// Tries to get the referenced object with the specified id.
/// </summary>
/// <param name="reference">The reference.</param>
/// <param name="value">The value.</param>
/// <returns><see langword="true" /> if there was a referenced object with the specified id, <see langword="false" /> otherwise.</returns>
Tries to get the referenced object with the specified id.
Tries to get the referenced object with the specified id .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool TryGetReferencedObject(uint reference, [NotNullWhen(true)] out object value)
        {
            if (reference == 0)
            {
                value = null;
                return true;
            }
            for (int i = 0; i < ReferenceToObjectCount; ++i)
            {
                if (_referenceToObject[i].Id == reference)
                {
                    value = _referenceToObject[i].Object;
                    return true;
                }
            }
            if (_referenceToObjectOverflow is { } overflow)
            {
                return overflow.TryGetValue(reference, out value);
            }
            value = default;
            return false;
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public bool TryGetReferencedObject ( uint reference , [ NotNullWhen ( true ) ] out object value ) { if ( reference == 0 ) { value = null ; return true ; } for ( int i = 0 ; i < ReferenceToObjectCount ; ++ i ) { if ( _referenceToObject [ i ] . Id == reference ) { value = _referenceToObject [ i ] . Object ; return true ; } } if ( _referenceToObjectOverflow is { } overflow ) { return overflow . TryGetValue ( reference , out value ) ; } value = default ; return false ; }
Tries to get the referenced object with the specified id.
Tries to get the referenced object with the specified id .
// Reference 0 is always null.
if there was a referenced object with the specified id,  otherwise.
if there was a referenced object with the specified id otherwise .
reference
uint
None
out
[NotNullWhen(true)]
value
None