public override async Task Invoke(IOwinContext context) { var operationId = context.Get <string>(Consts.OperationIdContextKey); if (operationId != null) { OperationIdContext.Set(operationId); } await Next.Invoke(context); }
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()); }