Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.28 KB

File metadata and controls

32 lines (25 loc) · 1.28 KB

EnumerableExtensions.ToPivotTable<T,TPivoted,TKeys,TAggregate> method

Creates a pivot table (a table where columns are created from specified values in a collection) from a IEnumerable of T, using the specified selector and aggregators.

Example to be added soon
public static DataTable ToPivotTable<T, TPivoted, TKeys, TAggregate>(this IEnumerable<T> src, 
    Expression<Func<T, TKeys>> keysSelector, Expression<Func<T, TPivoted>> pivotSelectorExpr, 
    Func<IEnumerable<T>, TAggregate> aggregateSelector, string tableName = "Default")
parameter description
T Items type
TPivoted Type of the pivoted data
TKeys Type of the keys
TAggregate Type of computed aggregated data for each pivot
src Source collection
keysSelector Keys selector (used as keys for the groups aggregation for pivoted values will be computed on)
pivotSelectorExpr Expression to get the properties to compute the pivot on
aggregateSelector Aggregation calculation method
tableName Name of the created table

See Also