[]
Groups the elements of a view according to a specified key selector function.
public View<GroupView<TKey, T>> GroupBy<TKey>(Expression<Func<T, TKey>> keySelector)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | A function to extract the key for each element. |
Type | Description |
---|---|
View<GroupView<TKey, T>> | A view containing elements of type GroupView<TKey, TElement> each containing a key value and a view of the elements having that key value. |
Name | Description |
---|---|
TKey | The type of the key returned by keySelector. |
Groups the elements of a view according to a specified key selector function and projects the elements for each group by using a specified function.
public View<GroupView<TKey, TElement>> GroupBy<TKey, TElement>(Expression<Func<T, TKey>> keySelector, Expression<Func<T, TElement>> elementSelector)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | A function to extract the key for each element. |
Expression<Func<T, TElement>> | elementSelector | A function to map each source element to a TElement. |
Type | Description |
---|---|
View<GroupView<TKey, TElement>> | A view containing elements of type GroupView<TKey, TElement> each containing a key value and a view of the elements projected (mapped) from the elements having that key value. |
Name | Description |
---|---|
TKey | The type of the key returned by keySelector. |
TElement | The type of the element to which elements of each group are projected. |
Groups the elements of a view according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function.
public View<TResult> GroupBy<TKey, TElement, TResult>(Expression<Func<T, TKey>> keySelector, Expression<Func<T, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | A function to extract the key for each element. |
Expression<Func<T, TElement>> | elementSelector | A function to map each source element to an element in the IGrouping<TKey, TElement>. |
Expression<Func<TKey, IEnumerable<TElement>, TResult>> | resultSelector | A function to create a result value from each group. |
Type | Description |
---|---|
View<TResult> | A view of elements of type TResult where each element represents a projection over a group and its key. |
Name | Description |
---|---|
TKey | The type of the key returned by keySelector. |
TElement | The type of the elements in groups. |
TResult | The type of the result value returned by resultSelector. |