/// <summary> /// Шаг проверки файла по XSD схеме. /// </summary> /// <param name="app">Сборщик мидлвар.</param> /// <param name="configSection">настройки для мидлвары</param> /// <returns>Сборщик мидлвар с добавленным шагом проверки по схеме.</returns> public static IMiddlewareBuilder <CFTFileContext> UseValidationXSD( this IMiddlewareBuilder <CFTFileContext> app, IConfigurationSection configSection) { return(app.UseValidationXSD(options => { configSection.Bind(options); })); }
public IMiddlewareBuilder <CFTFileContext> ConfigureApplication( IMiddlewareBuilder <CFTFileContext> middlewareBuilder, IEnumerable <StepOptions> stepsOptions) { foreach (var stepOption in stepsOptions) { switch (stepOption.Type) { case StepType.MapWhenException: MapWhenException(middlewareBuilder, stepOption.Settings); break; case StepType.MapWhenFileName: MapWhenRegExpFileName(middlewareBuilder, stepOption.Settings); break; case StepType.XSDValidation: middlewareBuilder.UseValidationXSD(stepOption.Settings); break; case StepType.FileNameTransformation: middlewareBuilder.UseTransformFileName(stepOption.Settings); break; case StepType.XSLTransformation: middlewareBuilder.UseTransformXSLT(stepOption.Settings); break; case StepType.Export: middlewareBuilder.UseExport(stepOption.Settings); break; } } middlewareBuilder.UseRemove(option => { option.FileProviderType = _scanFileProviderType; option.FileProviderSettings = _scanFileProviderSettings; option.FileType = RemoveFileType.Input; }); return(middlewareBuilder); }