次の方法で共有


グループ化メソッド (LINQ to Entities)

ほとんどの LINQ グループ化メソッドは LINQ to Entities でサポートされていますが、Comparer はデータ ソースに変換できないため、IEqualityComparer を受け入れるものは例外です。詳細については、「LINQ to Entities クエリの標準クエリ演算子」を参照してください。次の表に、サポート対象のグループ化メソッドとサポート非対象のグループ化メソッドを示します。

サポート対象のメソッドとサポート非対象のメソッド

メソッド サポート Visual Basic 関数シグネチャ C# メソッド シグネチャ

GroupBy

サポート対象

Function GroupBy(Of TSource, TKey) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)) _
) As IQueryable(Of IGrouping(Of TKey, TSource))
IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector
)

GroupBy

サポート非対象

Function GroupBy(Of TSource, TKey) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
comparer As IEqualityComparer(Of TKey) _
) As IQueryable(Of IGrouping(Of TKey, TSource))
IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
IEqualityComparer<TKey> comparer
)

GroupBy

サポート対象

Function GroupBy(Of TSource, TKey, TElement) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
elementSelector As Expression(Of Func(Of TSource, TElement)) _
) As IQueryable(Of IGrouping(Of TKey, TElement))
IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
Expression<Func<TSource, TElement>> elementSelector
)

GroupBy

サポート対象

Function GroupBy(Of TSource, TKey, TResult) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
resultSelector As Expression(Of Func(Of TKey, IEnumerable(Of TSource), TResult)) _
) As IQueryable(Of TResult)
IQueryable<TResult> GroupBy<TSource, TKey, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector
)

GroupBy

サポート非対象

Function GroupBy(Of TSource, TKey, TElement) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
elementSelector As Expression(Of Func(Of TSource, TElement)), _
comparer As IEqualityComparer(Of TKey) _
) As IQueryable(Of IGrouping(Of TKey, TElement))
IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
Expression<Func<TSource, TElement>> elementSelector,
IEqualityComparer<TKey> comparer

GroupBy

サポート対象

Function GroupBy(Of TSource, TKey, TElement, TResult) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
elementSelector As Expression(Of Func(Of TSource, TElement)), _
resultSelector As Expression(Of Func(Of TKey, IEnumerable(Of TElement), TResult)) _
) As IQueryable(Of TResult)
IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
Expression<Func<TSource, TElement>> elementSelector,
Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector
)

GroupBy

サポート非対象

Function GroupBy(Of TSource, TKey, TResult) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
resultSelector As Expression(Of Func(Of TKey, IEnumerable(Of TSource), TResult)), _
comparer As IEqualityComparer(Of TKey) _
) As IQueryable(Of TResult)
IQueryable<TResult> GroupBy<TSource, TKey, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector,
IEqualityComparer<TKey> comparer
)

GroupBy

サポート非対象

Function GroupBy(Of TSource, TKey, TElement, TResult) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
elementSelector As Expression(Of Func(Of TSource, TElement)), _
resultSelector As Expression(Of Func(Of TKey, IEnumerable(Of TElement), TResult)), _
comparer As IEqualityComparer(Of TKey) _
) As IQueryable(Of TResult)
IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
Expression<Func<TSource, TElement>> elementSelector,
Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector,
IEqualityComparer<TKey> comparer
)

参照

概念

サポート対象のメソッドとサポート非対象のメソッド (LINQ to Entities)