public CorrelationIdMiddleware(RequestDelegate next, IOptions <CorrelationIdOptions> options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } _next = next ?? throw new ArgumentNullException(nameof(next)); _options = options.Value; }
public static IApplicationBuilder UseCorrelationId(this IApplicationBuilder app, CorrelationIdOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return(app.UseMiddleware <CorrelationIdMiddleware>(Options.Create(options))); }