private static void RunPatternQueryGrouped <TP, TR, TA, TK>(string name, Afa <TP, TR, TA> afa, IStreamable <Empty, TP> source, Expression <Func <TP, TK> > groupingKey) { Console.WriteLine("[Grouped] " + name); Console.WriteLine("Result: "); source.SetProperty().IsSyncTimeSimultaneityFree(true) .GroupApply(groupingKey, gc => gc.Detect(afa), (g, c) => new { Group = g.Key, Payload = c }) .ToStreamEventObservable() .Where(e => e.IsData) .ForEachAsync(x => Console.WriteLine("Time: {0} Payload: {1}", x.StartTime, x.Payload)).Wait(); Console.WriteLine(); }