public static AsyncFuncBuilder <TContext> WithAsyncCondition <TContext>(
     this AsyncFuncBuilder <TContext> asyncFuncBuilder,
     System.Func <TContext, Task <bool> > asyncCondition)
 {
     asyncFuncBuilder.AddStrategy(
         new AsyncCondition <TContext>(AsyncFunc <TContext> .Create(asyncCondition)));
     return(asyncFuncBuilder);
 }
 public static AsyncFuncBuilder <TInput> WithAdapter <TInput, TOutput>(
     this AsyncFuncBuilder <TInput> asyncFuncBuilder,
     Func <TInput, CancellationToken, Task <Option <Option <TOutput> > > > asyncTypeParser,
     System.Action <AsyncFuncBuilder <TOutput> > configuration)
 {
     asyncFuncBuilder.AddStrategy(
         new AsyncAdapter <TInput, TOutput>(
             AsyncFunc <TInput, TOutput> .Create(asyncTypeParser),
             configuration));
     return(asyncFuncBuilder);
 }
Ejemplo n.º 3
0
 public static IAsyncResultFunc <TContext> ToAsyncResultFunc <TContext>(this IAsyncFunc <TContext> func)
 => AsyncFunc <TContext> .Create(func);
Ejemplo n.º 4
0
 public static IAsyncResultFunc <TContext> ToAsyncResultFunc <TContext>(this IAsyncFunc <TContext> func)
 {
     return(AsyncFunc <TContext> .Create(func));
 }