public ValidateSwaggerRightMiddleware(RequestDelegate next, ValidateSwaggerRightMiddlewareOption option) { if (null == option) { throw new ArgumentNullException(nameof(option)); } _next = next ?? throw new ArgumentNullException(nameof(next)); _option = option; }
public static IApplicationBuilder AddValidateSwaggerRightFor(this IApplicationBuilder app, ValidateSwaggerRightMiddlewareOption option) { if (null == app) { throw new ArgumentNullException(nameof(app)); } return(app.UseMiddleware <ValidateSwaggerRightMiddleware>(option)); }