Пример #1
0
 public AspNetCoreCorrelationIdProvider(
     IHttpContextAccessor httpContextAccessor,
     IOptions <AbpCorrelationIdOptions> options)
 {
     HttpContextAccessor = httpContextAccessor;
     Options             = options.Value;
 }
Пример #2
0
    protected virtual void CheckAndSetCorrelationIdOnResponse(
        HttpContext httpContext,
        AbpCorrelationIdOptions options,
        string correlationId)
    {
        if (httpContext.Response.HasStarted)
        {
            return;
        }

        if (!options.SetResponseHeader)
        {
            return;
        }

        if (httpContext.Response.Headers.ContainsKey(options.HttpHeaderName))
        {
            return;
        }

        httpContext.Response.Headers[options.HttpHeaderName] = correlationId;
    }
Пример #3
0
 public AbpCorrelationIdMiddleware(IOptions <AbpCorrelationIdOptions> options,
                                   ICorrelationIdProvider correlationIdProvider)
 {
     _options = options.Value;
     _correlationIdProvider = correlationIdProvider;
 }