DevForce Help Reference
GroupBy<TSource,TKey,TResult>(IEntityQuery<TSource>,Expression<Func<TSource,TKey>>,Expression<Func<TKey,IEnumerable<TSource>,TResult>>) Method
Example 


Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
Syntax

Parameters

source
keySelector
resultSelector

Type Parameters

TSource
TKey
TResult
Example
var mgr = new DomainModelEntityManager();

var query = mgr.Customers.GroupBy(c => c.Country, (s, c) => new { Key=s, Count=c.Count()});
foreach (var group in query) {
  Console.WriteLine("key = " + group.Key);
  Console.WriteLine("count=" + group.Count);
}
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