Example #1
0
 /// <summary>Applies a key-generating function to each element of the input stream and yields a stream of unique keys and their frequency.</summary>
 /// <param name="projection">A function to transform items of the input stream into comparable keys.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>A stream of tuples where each tuple contains the unique key and a sequence of all the elements that match the key.</returns>    
 public static Stream<Tuple<TKey, int>> CountBy<TSource, TKey>(this Stream<TSource> stream, Func<TSource, TKey> projection)
 {
     return CSharpProxy.CountBy(stream, projection);
 }
Example #2
0
 /// <summary>
 /// Applies a key-generating function to each element of a CloudFlow and return a CloudFlow yielding unique keys and their number of occurrences in the original sequence.
 /// </summary>
 /// <param name="projection">A function that maps items from the input CloudFlow to keys.</param>
 /// <param name="stream">The input CloudFlow.</param>
 public static CloudFlow <Tuple <TKey, long> > CountBy <TSource, TKey>(this CloudFlow <TSource> stream, Func <TSource, TKey> projection)
 {
     return(CSharpProxy.CountBy(stream, projection));
 }