public static IDocumentProcessingBuilder Use(this IDocumentProcessingBuilder builder, Func<ProcessingContext, Func<Task>, Task> step) { return builder.Use(next => { return context => { Func<Task> simpleNext = () => next(context); return step(context, simpleNext); }; }); }
public static IDocumentProcessingBuilder UseStep <TStep>(this IDocumentProcessingBuilder builder, Func <TStep> step) where TStep : IDocumentProcessingStep { return(builder.Use(next => { return async context => { await step().InvokeAsync(context, next); }; })); }