public static IMiddlewareBuilder <CFTFileContext> UseRemove( this IMiddlewareBuilder <CFTFileContext> app, Action <RemoveFileOptions> configOption) { var options = new RemoveFileOptions(); configOption(options); app.UseMiddleware <RemoveFileMiddleWare, CFTFileContext>(options); return(app); }
public RemoveFileMiddleWare( MiddlewareDelegate <CFTFileContext> next, ILogger <RemoveFileMiddleWare> logger, IFileProviderFactory fileProviderFactory, RemoveFileOptions options) : base(next, logger) { try { options.ValidationParams(); _fileProvider = fileProviderFactory.GetFileProvider(options.FileProviderType, options.FileProviderSettings); } catch (Exception e) { throw new CFTConfigurationException("Ошибка при конфигурации модуля проверки по XSD схеме.", e); } _option = options; }