public static RequestFilteringOptions AddRequestFilter(this RequestFilteringOptions requestFilteringOptions, IRequestFilter filter) { if (filter == null) { throw new ArgumentNullException(nameof(filter)); } requestFilteringOptions.Filters.Add(filter); return(requestFilteringOptions); }
public RequestFilteringMiddleware( RequestDelegate next, RequestFilteringOptions options) { if (next == null) { throw new ArgumentNullException(nameof(next)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } _next = next; _options = options; }
public static IApplicationBuilder UseRequestFiltering(this IApplicationBuilder app, RequestFilteringOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return app.UseMiddleware<RequestFilteringMiddleware>(options); }