public CorrelationService(IHttpContextAccessor httpContextAccessor, IApplicationContext applicationContext, ILogger <CorrelationService> logger, ICorrelationContextFormatter correlationContextFormatter) { _httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor)); _applicationContext = applicationContext ?? throw new ArgumentNullException(nameof(applicationContext)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _correlationContextFormatter = correlationContextFormatter ?? throw new ArgumentNullException(nameof(correlationContextFormatter)); }
public CorrelationMiddleware(RequestDelegate next, ILogger <CorrelationMiddleware> logger, ICorrelationService correlationService, IOptions <CorrelationOptions> options, ICorrelationContextFormatter correlationContextFormatter) { _next = next ?? throw new ArgumentNullException(nameof(next), $"{nameof(next)} cannot be null."); _logger = logger ?? throw new ArgumentNullException(nameof(logger), $"{nameof(logger)} cannot be null."); _correlationService = correlationService ?? throw new ArgumentNullException(nameof(correlationService)); _options = options ?? throw new ArgumentNullException(nameof(options)); _correlationContextFormatter = correlationContextFormatter ?? throw new ArgumentNullException(nameof(correlationContextFormatter)); }