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 soonpublic 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 |
- class EnumerableExtensions
- namespace Wokhan.Collections.Generic.Extensions