TSource
IdeaBlade DevForce 2010 Help Reference
GroupBy<TSource>(IEntityQuery<TSource>,IProjectionSelector,IProjectionSelector) Method
See Also  Example Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityQueryExtensions Class > GroupBy Method : GroupBy<TSource>(IEntityQuery<TSource>,IProjectionSelector,IProjectionSelector) Method



source
keySelector
elementSelector
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

Visual Basic (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
Visual Basic (Usage)Copy Code
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

C#Copy Code
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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.