ComponentOne Data Source for Entity Framework
C1.LiveLinq Namespace / IndexedQueryExtensions Class / GroupBy Method / GroupBy<TSource,TKey,TElement,TResult>(IIndexedSource<TSource>,Expression<Func<TSource,TKey>>,Expression<Func<TSource,TElement>>,Expression<Func<TKey,IEnumerable<TElement>,TResult>>) Method
The type of the elements of source.
The type of the key returned by keySelector.
The type of the elements in the System.Linq.IGrouping`2.
The type of the result value returned by resultSelector
An C1.LiveLinq.Indexing.IIndexedSource<T> whose elements to group
A function to extract the key for each element.
A function to map each source element to an element in the System.Linq.IGrouping`2.
A function to create a result value from each group.

In This Topic
    GroupBy<TSource,TKey,TElement,TResult>(IIndexedSource<TSource>,Expression<Func<TSource,TKey>>,Expression<Func<TSource,TElement>>,Expression<Func<TKey,IEnumerable<TElement>,TResult>>) Method
    In This Topic
    Groups the elements of a collection 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.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function GroupBy
        (Of TSource,TKey,TElement,TResult)( _
       ByVal source As IIndexedSource(Of TSource), _
       ByVal keySelector As System.Linq.Expressions.Expression(Of Func(Of TSource,TKey)), _
       ByVal elementSelector As System.Linq.Expressions.Expression(Of Func(Of TSource,TElement)), _
       ByVal resultSelector As System.Linq.Expressions.Expression(Of Func(Of TKey,IEnumerable(Of TElement),TResult)) _
    ) As IIndexedSource(Of TResult)
    public static IIndexedSource<TResult> GroupBy<TSource,TKey,TElement,TResult>( 
       IIndexedSource<TSource> source,
       System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector,
       System.Linq.Expressions.Expression<Func<TSource,TElement>> elementSelector,
       System.Linq.Expressions.Expression<Func<TKey,IEnumerable<TElement>,TResult>> resultSelector
    )

    Parameters

    source
    An C1.LiveLinq.Indexing.IIndexedSource<T> whose elements to group
    keySelector
    A function to extract the key for each element.
    elementSelector
    A function to map each source element to an element in the System.Linq.IGrouping`2.
    resultSelector
    A function to create a result value from each group.

    Type Parameters

    TSource
    The type of the elements of source.
    TKey
    The type of the key returned by keySelector.
    TElement
    The type of the elements in the System.Linq.IGrouping`2.
    TResult
    The type of the result value returned by resultSelector

    Return Value

    A collection of elements of type TResult where each element represents a projection over a group and its key.
    See Also