ApplicationInsights.OwinExtensions.OperationIdContext.Create C# (CSharp) Method

Create() public static method

public static Create ( ) : void
return void
        public static void Create()
        {
            CallContext.LogicalSetData(Consts.OperationIdContextKey, _strategy.GenerateId());
        }

Usage Example

Exemplo n.º 1
0
        private void InitializeOperationIdContext(IOwinContext context)
        {
            string idContextKey;

            if (_configuration.ShouldTryGetIdFromHeader &&
                TryGetIdFromHeader(context, out idContextKey))
            {
                OperationIdContext.Set(idContextKey);
            }
            else
            {
                OperationIdContext.Create();
            }

            context.Set(Consts.OperationIdContextKey, OperationIdContext.Get());
        }