Beispiel #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());
        }
Beispiel #2
0
 public static ISequence <int> Count(this ISequence source)
 {
     return(source.AsObjects().Count(null));
 }
Beispiel #3
0
 private Task <object> EvaluateInternal <T>(ISequence <T> input, CancellationToken cancel)
 {
     return(input.AsObjects().FirstOrDefaultAsync().ResultAsObject());
 }
Beispiel #4
0
 public static ISequence <T> OfType <T>(this ISequence source)
 {
     return(source.AsObjects().Where(x => x is T).Select(x => (T)x));
 }
Beispiel #5
0
        private ISequence <object> Evaluate(ISequence input, Delegate func)
        {
            var selector = (Func <object, CancellationToken, Task <object> >)func;

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