public static IApplicationBuilder UseBusinessException(this IApplicationBuilder builder, Action <BusinessExceptionOption> options) { var o = new BusinessExceptionOption(); options.Invoke(o); return(builder.UseMiddleware <BusinessExceptionMiddleware>(Options.Create(o))); }
public BusinessExceptionMiddleware(RequestDelegate next, ILogger <BusinessExceptionMiddleware> logger, IOptions <BusinessExceptionOption> options) { _next = next; _logger = logger; _options = options.Value; }