Exemplo n.º 1
0
        private ISequence <object> Evaluate(ISequence input, Delegate func, bool sequential)
        {
            var selector  = (Func <object, CancellationToken, Task <object> >)func;
            var sequences = input.AsObjects().SelectAsync(selector).Cast <ISequence>().Select(x => x.AsObjects());

            return(sequential ? sequences.Concat() : sequences.Merge());
        }
Exemplo n.º 2
0
 public static ISequence <int> Count(this ISequence source)
 {
     return(source.AsObjects().Count(null));
 }
Exemplo n.º 3
0
 private Task <object> EvaluateInternal <T>(ISequence <T> input, CancellationToken cancel)
 {
     return(input.AsObjects().FirstOrDefaultAsync().ResultAsObject());
 }
Exemplo n.º 4
0
 public static ISequence <T> OfType <T>(this ISequence source)
 {
     return(source.AsObjects().Where(x => x is T).Select(x => (T)x));
 }
Exemplo n.º 5
0
        private ISequence <object> Evaluate(ISequence input, Delegate func)
        {
            var selector = (Func <object, CancellationToken, Task <object> >)func;

            return(input.AsObjects().SelectAsync(selector));
        }