[This is preliminary documentation and is subject to change.]
Groups records using the supplied key selector, and computes the sum of the records in each group.
Namespace: Microsoft.Research.Naiad.Frameworks.DifferentialDataflow
Assembly: Microsoft.Research.Naiad.DifferentialDataflow (in Microsoft.Research.Naiad.DifferentialDataflow.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax
C#
Collection<TOutput, TTime> Sum<TKey, TOutput>( Expression<Func<TRecord, TKey>> keySelector, Expression<Func<TRecord, int>> valueSelector, Expression<Func<TKey, int, TOutput>> resultSelector ) where TKey : Object, IEquatable<TKey> where TOutput : Object, IEquatable<TOutput>
Parameters
- keySelector
- Type: System.Linq.ExpressionsExpressionFuncTRecord, TKey
Function that extracts a key from each record. - valueSelector
- Type: System.Linq.ExpressionsExpressionFuncTRecord, Int32
Function that extracts the integer value to be summed each record. - resultSelector
- Type: System.Linq.ExpressionsExpressionFuncTKey, Int32, TOutput
Function that transforms a key and count to an output record.
Type Parameters
- TKey
- The key type.
- TOutput
- The output type.
Return Value
Type: CollectionTOutput, TTimeThe collection of output records.
See Also