예제 #1
0
 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);
         };
     });
 }
예제 #2
0
 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);
         };
     }));
 }