次の方法で共有


並べ替えメソッド (LINQ to Entities)

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

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

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

OrderBy

サポート対象

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

OrderBy

サポート非対象

Function OrderBy(Of TSource, TKey) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
comparer As IComparer(Of TKey) _
) As IOrderedQueryable(Of TSource)
IOrderedQueryable<TSource> OrderBy<TSource, TKey>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
IComparer<TKey> comparer
)

OrderByDescending

サポート対象

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

OrderByDescending

サポート非対象

Function OrderByDescending(Of TSource, TKey) ( _
source As IQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
comparer As IComparer(Of TKey) _
) As IOrderedQueryable(Of TSource)
IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(
this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
IComparer<TKey> comparer
)

ThenBy

サポート対象

Function ThenBy(Of TSource, TKey) ( _
source As IOrderedQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)) _
) As IOrderedQueryable(Of TSource)
IOrderedQueryable<TSource> ThenBy<TSource, TKey>(
this IOrderedQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector
)

ThenBy

サポート非対象

Function ThenBy(Of TSource, TKey) ( _
source As IOrderedQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
comparer As IComparer(Of TKey) _
) As IOrderedQueryable(Of TSource)
IOrderedQueryable<TSource> ThenBy<TSource, TKey>(
this IOrderedQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
IComparer<TKey> comparer
) 

ThenByDescending

サポート対象

Function ThenByDescending(Of TSource, TKey) ( _
source As IOrderedQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)) _
) As IOrderedQueryable(Of TSource)
IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(
this IOrderedQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector
)

ThenByDescending

サポート非対象

Function ThenByDescending(Of TSource, TKey) ( _
source As IOrderedQueryable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
comparer As IComparer(Of TKey) _
) As IOrderedQueryable(Of TSource)
IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(
this IOrderedQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
IComparer<TKey> comparer
)

Reverse

サポート対象

Function Reverse(Of TSource) ( _
source As IQueryable(Of TSource) _
) As IQueryable(Of TSource)
IQueryable<TSource> Reverse<TSource>(
this IQueryable<TSource> source
)

参照

概念

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