DevForce Help Reference
GroupBy<TSource>(IEntityQuery<TSource>,IProjectionSelector,IProjectionSelector) Method
Example 


Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function GroupBy(Of TSource)( _
   ByVal source As IEntityQuery(Of TSource), _
   ByVal keySelector As IProjectionSelector, _
   ByVal elementSelector As IProjectionSelector _
) As ITypedEntityQuery
'Usage
 
Dim source As IEntityQuery(Of TSource)
Dim keySelector As IProjectionSelector
Dim elementSelector As IProjectionSelector
Dim value As ITypedEntityQuery
 
value = EntityQueryExtensions.GroupBy(Of TSource)(source, keySelector, elementSelector)

Parameters

source
keySelector
elementSelector

Type Parameters

TSource
Example
var mgr = new DomainModelEntityManager();

var keyPs = new ProjectionSelector("Country");
var elementPs = new ProjectionSelector("CompanyName");

var query = mgr.Customers.GroupBy(keyPs, elementPs);
var results = query.Execute();
var r0List = results.Cast<IGrouping<String, String>>().ToList();
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityQueryExtensions Class
EntityQueryExtensions Members
Overload List

Send Feedback