src/Orleans.Core/Runtime/RequestContextExtensions.cs
/// <summary>
/// Exports a copy of the current <see cref="RequestContext"/>.
/// </summary>
/// <param name="copier">The copier.</param>
/// <returns>A copy of the current request context.</returns>
Exports a copy of the current .
Exports a copy of the current .
public static Dictionary<string, object> Export(DeepCopier copier)
        {
            var values = RequestContext.CallContextData.Value;
            if (RequestContext.PropagateActivityId)
            {
                var activityIdOverride = Trace.CorrelationManager.ActivityId;
                if (activityIdOverride != Guid.Empty)
                {
                    object existingActivityId;
                    if (values == null
                        || !values.TryGetValue(RequestContext.E2_E_TRACING_ACTIVITY_ID_HEADER, out existingActivityId)
                        || activityIdOverride != (Guid)existingActivityId)
                    {
                        values = values == null ? new Dictionary<string, object>() : new Dictionary<string, object>(values);
                        values[RequestContext.E2_E_TRACING_ACTIVITY_ID_HEADER] = activityIdOverride;
                    }
                }
            }
            return (values != null && values.Count > 0)
                ? copier.Copy(values)
                : null;
        }
public static Dictionary < string , object > Export ( DeepCopier copier ) { var values = RequestContext . CallContextData . Value ; if ( RequestContext . PropagateActivityId ) { var activityIdOverride = Trace . CorrelationManager . ActivityId ; if ( activityIdOverride != Guid . Empty ) { object existingActivityId ; if ( values == null || ! values . TryGetValue ( RequestContext . E2_E_TRACING_ACTIVITY_ID_HEADER , out existingActivityId ) || activityIdOverride != ( Guid ) existingActivityId ) { values = values == null ? new Dictionary < string , object > ( ) : new Dictionary < string , object > ( values ) ; values [ RequestContext . E2_E_TRACING_ACTIVITY_ID_HEADER ] = activityIdOverride ; } } } return ( values != null && values . Count > 0 ) ? copier . Copy ( values ) : null ; }
Exports a copy of the current .
Exports a copy of the current .
// Create new copy before mutating data
A copy of the current request context.
A copy of the current request context .
copier
DeepCopier
None