public static IMiddlewareBuilder <CFTFileContext> UseExport(
     this IMiddlewareBuilder <CFTFileContext> app,
     IConfigurationSection configSection)
 {
     return(app.UseExport(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);
        }