Méthodes LINQ prises en charge et non prises en charge (LINQ to Entities)Supported and Unsupported LINQ Methods (LINQ to Entities)

Cette section fournit des informations sur les opérateurs de requête standard LINQ (Language-Integrated Query) qui sont pris en charge ou non pris en charge dans les requêtes LINQ to EntitiesLINQ to Entities.This section provides information about the Language-Integrated Query (LINQ) standard query operators that are supported or unsupported in LINQ to EntitiesLINQ to Entities queries. De nombreux opérateurs de requête standard LINQ ont une version surchargée qui accepte un argument entier.Many of the LINQ standard query operators have an overloaded version that accepts an integer argument. L’argument entier correspond à un index de base zéro de la séquence qui est traitée, une IEqualityComparer<T>, ou IComparer<T>.The integer argument corresponds to a zero-based index in the sequence that is being operated on, an IEqualityComparer<T>, or IComparer<T>. Sauf spécification contraire, ces versions surchargées des opérateurs de requête standard LINQ ne sont pas prises en charge et toute tentative pour les utiliser lèvera une exception.Unless otherwise specified, these overloaded versions of the LINQ standard query operators are not supported, and attempting to use them will throw an exception.

Méthodes de projection et de restrictionProjection and Restriction Methods

La plupart des méthodes de projection et de restriction LINQ sont prises en charge dans les requêtes LINQ to EntitiesLINQ to Entities, à l'exception de celles qui acceptent un argument positionnel.Most of the LINQ projection and restriction methods are supported in LINQ to EntitiesLINQ to Entities queries, with the exception of those that accept a positional argument. Pour plus d’informations, consultez des opérateurs de requête Standard dans les requêtes LINQ to Entities.For more information, see Standard Query Operators in LINQ to Entities Queries. Le tableau suivant répertorie les méthodes de projection et de restriction prises en charge et non prises en charge.The following table lists the supported and unsupported projection and restriction methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
Select Pris en chargeSupported Function Select(Of TSource, TResult) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, TResult)) _ ) As IQueryable(Of TResult) IQueryable<TResult> Select<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector )
Select Non pris en chargeNot supported Function Select(Of TSource, TResult) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Integer, TResult)) _ ) As IQueryable(Of TResult) IQueryable<TResult> Select<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, int, TResult>> selector )
SelectMany Pris en chargeSupported Function SelectMany(Of TSource, TResult) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, IEnumerable(Of TResult))) _ ) As IQueryable(Of TResult) IQueryable<TResult> SelectMany<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector )
SelectMany Non pris en chargeNot supported Function SelectMany(Of TSource, TResult) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Integer, IEnumerable(Of TResult))) _ ) As IQueryable(Of TResult) IQueryable<TResult> SelectMany<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, int, IEnumerable<TResult>>> selector )
SelectMany Pris en chargeSupported Function SelectMany(Of TSource, TCollection, TResult) ( _ source As IQueryable(Of TSource), _ collectionSelector As Expression(Of Func(Of TSource, IEnumerable(Of TCollection))), _ resultSelector As Expression(Of Func(Of TSource, TCollection, TResult)) _ ) As IQueryable(Of TResult) IQueryable<TResult> SelectMany\<TSource, TCollection, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func\<TSource, TCollection, TResult>> resultSelector )
SelectMany Non pris en chargeNot supported Function SelectMany(Of TSource, TCollection, TResult) ( _ source As IQueryable(Of TSource), _ collectionSelector As Expression(Of Func(Of TSource, Integer, IEnumerable(Of TCollection))), _ resultSelector As Expression(Of Func(Of TSource, TCollection, TResult)) _ ) As IQueryable(Of TResult) IQueryable<TResult> SelectMany\<TSource, TCollection, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, int, IEnumerable<TCollection>>> collectionSelector, Expression<Func\<TSource, TCollection, TResult>> resultSelector )
Where Pris en chargeSupported Function Where(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As IQueryable(Of TSource) IQueryable<TSource> Where<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
Where Non pris en chargeNot supported Function Where(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Integer, Boolean)) _ ) As IQueryable(Of TSource) IQueryable<TSource> Where<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, int, bool>> predicate )

Méthodes de jointureJoin Methods

Les méthodes de jointure LINQ sont prises en charge dans LINQ to EntitiesLINQ to Entities, à l'exception de celles qui acceptent un IEqualityComparer, car le comparateur ne peut pas être traduit dans la source de données.The LINQ join methods are supported in LINQ to EntitiesLINQ to Entities, with the exception of those that accept an IEqualityComparer because the comparer cannot be translated to the data source. Pour plus d’informations, consultez des opérateurs de requête Standard dans les requêtes LINQ to Entities.For more information, see Standard Query Operators in LINQ to Entities Queries. Le tableau suivant répertorie les méthodes de jointure prises en charge et non prises en charge.The following table lists the supported and unsupported join methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
GroupJoin Pris en chargeSupported Function GroupJoin(Of TOuter, TInner, TKey, TResult) ( _ outer As IQueryable(Of TOuter), _ inner As IEnumerable(Of TInner), _ outerKeySelector As Expression(Of Func(Of TOuter, TKey)), _ innerKeySelector As Expression(Of Func(Of TInner, TKey)), _ resultSelector As Expression(Of Func(Of TOuter, IEnumerable(Of TInner), TResult)) _ ) As IQueryable(Of TResult) IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>( this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector )
GroupJoin Non prise en chargeNot Supported Function GroupJoin(Of TOuter, TInner, TKey, TResult) ( _ outer As IQueryable(Of TOuter), _ inner As IEnumerable(Of TInner), _ outerKeySelector As Expression(Of Func(Of TOuter, TKey)), _ innerKeySelector As Expression(Of Func(Of TInner, TKey)), _ resultSelector As Expression(Of Func(Of TOuter, IEnumerable(Of TInner), TResult)), _ comparer As IEqualityComparer(Of TKey) _ ) As IQueryable(Of TResult) IQueryable<TResult> GroupJoin\<TOuter, TInner, TKey, TResult>( this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func\<TOuter, TKey>> outerKeySelector, Expression<Func\<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector, IEqualityComparer<TKey> comparer )
Join Pris en chargeSupported Function Join(Of TOuter, TInner, TKey, TResult) ( _ outer As IQueryable(Of TOuter), _ inner As IEnumerable(Of TInner), _ outerKeySelector As Expression(Of Func(Of TOuter, TKey)), _ innerKeySelector As Expression(Of Func(Of TInner, TKey)), _ resultSelector As Expression(Of Func(Of TOuter, TInner, TResult)) _ ) As IQueryable(Of TResult) IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>( this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector )
Join Non prise en chargeNot Supported Function Join(Of TOuter, TInner, TKey, TResult) ( _ outer As IQueryable(Of TOuter), _ inner As IEnumerable(Of TInner), _ outerKeySelector As Expression(Of Func(Of TOuter, TKey)), _ innerKeySelector As Expression(Of Func(Of TInner, TKey)), _ resultSelector As Expression(Of Func(Of TOuter, TInner, TResult)), _ comparer As IEqualityComparer(Of TKey) _ ) As IQueryable(Of TResult) IQueryable<TResult> Join\<TOuter, TInner, TKey, TResult>( this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func\<TOuter, TKey>> outerKeySelector, Expression<Func\<TInner, TKey>> innerKeySelector, Expression<Func\<TOuter, TInner, TResult>> resultSelector, IEqualityComparer<TKey> comparer )

Définir des méthodesSet Methods

La plupart de l’ensemble LINQ sont prises en charge dans LINQ to EntitiesLINQ to Entities requêtes, à l’exception de celles qui utilisent un EqualityComparer<T>.Most of the LINQ set methods are supported in LINQ to EntitiesLINQ to Entities queries, with the exception of those that use an EqualityComparer<T>. Pour plus d’informations, consultez des opérateurs de requête Standard dans les requêtes LINQ to Entities.For more information, see Standard Query Operators in LINQ to Entities Queries. Le tableau suivant répertorie les méthodes de définition prises en charge et non prises en charge.The following table lists the supported and unsupported set methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
All Pris en chargeSupported Function All(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As Boolean bool All<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
Any Pris en chargeSupported Function Any(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As Boolean bool Any<TSource>( this IQueryable<TSource> source )
Any Pris en chargeSupported Function Any(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As Boolean bool Any<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
Contains Pris en chargeSupported Function Contains(Of TSource) ( _ source As IQueryable(Of TSource), _ item As TSource _ ) As Boolean bool Contains<TSource>( this IQueryable<TSource> source, TSource item )
Contains Non pris en chargeNot supported Function Contains(Of TSource) ( _ source As IQueryable(Of TSource), _ item As TSource, _ comparer As IEqualityComparer(Of TSource) _ ) As Boolean bool Contains<TSource>( this IQueryable<TSource> source, TSource item, IEqualityComparer<TSource> comparer )
Concat Prise en charge, mais sansSupported, but there is no

aucune garantie que l'ordre sera conservéguarantee of order being preserved
Function Concat(Of TSource) ( _ source1 As IQueryable(Of TSource), _ source2 As IEnumerable(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Concat<TSource>( this IQueryable<TSource> source1, IEnumerable<TSource> source2 )
DefaultIfEmpty Pris en chargeSupported Function DefaultIfEmpty(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> DefaultIfEmpty<TSource>( this IQueryable<TSource> source )
DefaultIfEmpty Pris en chargeSupported Function DefaultIfEmpty(Of TSource) ( _ source As IQueryable(Of TSource), _ defaultValue As TSource _ ) As IQueryable(Of TSource) IQueryable<TSource> DefaultIfEmpty<TSource>( this IQueryable<TSource> source, TSource defaultValue )
Distinct Pris en chargeSupported Function Distinct(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Distinct<TSource>( this IQueryable<TSource> source )
Distinct Non pris en chargeNot supported Function Distinct(Of TSource) ( _ source As IQueryable(Of TSource), _ comparer As IEqualityComparer(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Distinct<TSource>( this IQueryable<TSource> source, IEqualityComparer<TSource> comparer )
Except Pris en chargeSupported Function Except(Of TSource) ( _ source1 As IQueryable(Of TSource), _ source2 As IEnumerable(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Except<TSource>( this IQueryable<TSource> source1, IEnumerable<TSource> source2 )
Except Non pris en chargeNot supported Function Except(Of TSource) ( _ source1 As IQueryable(Of TSource), _ source2 As IEnumerable(Of TSource), _ comparer As IEqualityComparer(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Except<TSource>( this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer )
Intersect Pris en chargeSupported Function Intersect(Of TSource) ( _ source1 As IQueryable(Of TSource), _ source2 As IEnumerable(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Intersect<TSource>( this IQueryable<TSource> source1, IEnumerable<TSource> source2 )
Intersect Non pris en chargeNot supported Function Intersect(Of TSource) ( _ source1 As IQueryable(Of TSource), _ source2 As IEnumerable(Of TSource), _ comparer As IEqualityComparer(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Intersect<TSource>( this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer )
Union Pris en chargeSupported Function Union(Of TSource) ( _ source1 As IQueryable(Of TSource), _ source2 As IEnumerable(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Union<TSource>( this IQueryable<TSource> source1, IEnumerable<TSource> source2 )
Union Non pris en chargeNot supported Function Union(Of TSource) ( _ source1 As IQueryable(Of TSource), _ source2 As IEnumerable(Of TSource), _ comparer As IEqualityComparer(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Union<TSource>( this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer )

Méthodes de classementOrdering Methods

La plupart des méthodes de classement LINQ est prises en charge dans LINQ to EntitiesLINQ to Entities, à l’exception de celles qui acceptent un IComparer<T>, car le comparateur ne peut pas être traduit dans la source de données.Most of the LINQ ordering methods are supported in LINQ to EntitiesLINQ to Entities, with the exception of those that accept an IComparer<T>, because the comparer cannot be translated to the data source. Pour plus d’informations, consultez des opérateurs de requête Standard dans les requêtes LINQ to Entities.For more information, see Standard Query Operators in LINQ to Entities Queries. Le tableau suivant répertorie les méthodes de tri prises en charge et non prises en charge.The following table lists the supported and unsupported ordering methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
OrderBy Pris en chargeSupported 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 Non pris en chargeNot supported 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 Pris en chargeSupported 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 Non pris en chargeNot supported 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 Pris en chargeSupported 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 Non pris en chargeNot supported 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 Pris en chargeSupported 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 Non pris en chargeNot supported 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 Non pris en chargeNot supported Function Reverse(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As IQueryable(Of TSource) IQueryable<TSource> Reverse<TSource>( this IQueryable<TSource> source )

Méthodes de regroupementGrouping Methods

La plupart des méthodes de regroupement LINQ est prises en charge dans LINQ to EntitiesLINQ to Entities, à l’exception de celles qui acceptent un IEqualityComparer<T>, car le comparateur ne peut pas être traduit dans la source de données.Most of the LINQ grouping methods are supported in LINQ to EntitiesLINQ to Entities, with the exception of those that accept an IEqualityComparer<T>, because the comparer cannot be translated to the data source. Pour plus d’informations, consultez des opérateurs de requête Standard dans les requêtes LINQ to Entities.For more information, see Standard Query Operators in LINQ to Entities Queries. Le tableau suivant répertorie les méthodes de regroupement prises en charge et non prises en charge.The following table lists the supported and unsupported grouping methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
GroupBy Pris en chargeSupported 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 Non pris en chargeNot supported 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 Pris en chargeSupported 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 Pris en chargeSupported 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 Non pris en chargeNot supported 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 Pris en chargeSupported 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 Non pris en chargeNot supported 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 Non pris en chargeNot supported 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 )

Méthodes d'agrégationAggregate Methods

La plupart des méthodes d'agrégation qui acceptent des types de données primitifs sont prises en charge dans LINQ to EntitiesLINQ to Entities.Most of the aggregate methods that accept primitive data types are supported in LINQ to EntitiesLINQ to Entities. Pour plus d’informations, consultez des opérateurs de requête Standard dans les requêtes LINQ to Entities.For more information, see Standard Query Operators in LINQ to Entities Queries. Le tableau suivant répertorie les méthodes d'agrégation prises en charge et non prises en charge.The following table lists the supported and unsupported aggregate methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
Aggregate Non pris en chargeNot supported Function Aggregate(Of TSource) ( _ source As IQueryable(Of TSource), _ func As Expression(Of Func(Of TSource, TSource, TSource)) _ ) As TSource TSource Aggregate<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, TSource, TSource>> func )
Aggregate Non pris en chargeNot supported Function Aggregate(Of TSource, TAccumulate) ( _ source As IQueryable(Of TSource), _ seed As TAccumulate, _ func As Expression(Of Func(Of TAccumulate, TSource, TAccumulate)) _ ) As TAccumulate TAccumulate Aggregate<TSource, TAccumulate>( this IQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> func )
Aggregate Non pris en chargeNot supported Function Aggregate(Of TSource, TAccumulate, TResult) ( _ source As IQueryable(Of TSource), _ seed As TAccumulate, _ func As Expression(Of Func(Of TAccumulate, TSource, TAccumulate)), _ selector As Expression(Of Func(Of TAccumulate, TResult)) _ ) As TResult TResult Aggregate<TSource, TAccumulate, TResult>( this IQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> func, Expression<Func<TAccumulate, TResult>> selector )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Decimal) _ ) As Decimal decimal Average( this IQueryable<decimal> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Double) _ ) As Double double Average( this IQueryable<double> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Integer) _ ) As Double double Average( this IQueryable<int> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Long) _ ) As Double double Average( this IQueryable<long> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Nullable(Of Decimal)) _ ) As Nullable(Of Decimal) Nullable<decimal> Average( this IQueryable<Nullable<decimal>> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Nullable(Of Double)) _ ) As Nullable(Of Double) Nullable<double> Average( this IQueryable<Nullable<double>> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Nullable(Of Integer)) _ ) As Nullable(Of Double) Nullable<double> Average( this IQueryable<Nullable<int>> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Nullable(Of Long)) _ ) As Nullable(Of Double) Nullable<double> Average( this IQueryable<Nullable<long>> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Nullable(Of Single)) _ ) As Nullable(Of Single) Nullable<float> Average( this IQueryable<Nullable<float>> source )
Average Pris en chargeSupported Function Average ( _ source As IQueryable(Of Single) _ ) As Single float Average( this IQueryable<float> source )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Integer)) _ ) As Double double Average<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, int>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Integer))) _ ) As Nullable(Of Double) Nullable<double> Average<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<int>>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Long)) _ ) As Double double Average<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, long>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Long))) _ ) As Nullable(Of Double) Nullable<double> Average<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<long>>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Single)) _ ) As Single float Average<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, float>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Single))) _ ) As Nullable(Of Single) Nullable<float> Average<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<float>>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Double)) _ ) As Double double Average<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, double>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Double))) _ ) As Nullable(Of Double) Nullable<double> Average<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<double>>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Decimal)) _ ) As Decimal decimal Average<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, decimal>> selector )
Average Non pris en chargeNot supported Function Average(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Decimal))) _ ) As Nullable(Of Decimal) Nullable<decimal> Average<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<decimal>>> selector )
Count Pris en chargeSupported Function Count(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As Integer int Count<TSource>( this IQueryable<TSource> source )
Count Non pris en chargeNot supported Function Count(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As Integer int Count<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
LongCount Pris en chargeSupported Function LongCount(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As Long long LongCount<TSource>( this IQueryable<TSource> source )
LongCount Non pris en chargeNot supported Function LongCount(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As Long long LongCount<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
Max Pris en chargeSupported Function Max(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource Max<TSource>( this IQueryable<TSource> source )
Max Non pris en chargeNot supported Function Max(Of TSource, TResult) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, TResult)) _ ) As TResult TResult Max<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector )
Min Pris en chargeSupported Function Min(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource Min<TSource>( this IQueryable<TSource> source )
Min Non pris en chargeNot supported Function Min(Of TSource, TResult) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, TResult)) _ ) As TResult TResult Min<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Decimal) _ ) As Decimal decimal Sum( this IQueryable<decimal> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Double) _ ) As Double double Sum( this IQueryable<double> source
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Integer) _ ) As Integer int Sum( this IQueryable<int> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Long) _ ) As Long long Sum( this IQueryable<long> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Nullable(Of Decimal)) _ ) As Nullable(Of Decimal) Nullable<decimal> Sum( this IQueryable<Nullable<decimal>> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Nullable(Of Double)) _ ) As Nullable(Of Double) Function Sum ( _ source As IQueryable(Of Nullable(Of Double)) _ ) As Nullable(Of Double)Nullable<double> Sum( this IQueryable<Nullable<double>> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Nullable(Of Integer)) _ ) As Nullable(Of Integer) Nullable<int> Sum( this IQueryable<Nullable<int>> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Nullable(Of Long)) _ ) As Nullable(Of Long) Nullable<long> Sum( this IQueryable<Nullable<long>> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Nullable(Of Single)) _ ) As Nullable(Of Single) Nullable<float> Sum( this IQueryable<Nullable<float>> source )
Sum Pris en chargeSupported Function Sum ( _ source As IQueryable(Of Single) _ ) As Single float Sum( this IQueryable<float> source )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Integer)) _ ) As Integer int Sum<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, int>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Integer))) _ ) As Nullable(Of Integer) Nullable<int> Sum<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<int>>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Long)) _ ) As Long long Sum<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, long>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Long))) _ ) As Nullable(Of Long) Nullable<long> Sum<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<long>>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Single))) _ ) As Nullable(Of Single) Nullable<float> Sum<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<float>>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Single)) _ ) As Single float Sum<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, float>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Double)) _ ) As Double double Sum<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, double>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Double))) _ ) As Nullable(Of Double) Nullable<double> Sum<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<double>>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Decimal)) _ ) As Decimal decimal Sum<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, decimal>> selector )
Sum Non pris en chargeNot supported Function Sum(Of TSource) ( _ source As IQueryable(Of TSource), _ selector As Expression(Of Func(Of TSource, Nullable(Of Decimal))) _ ) As Nullable(Of Decimal) Nullable<decimal> Sum<TSource>( this IQueryable<TSource> source, Expression<Func<TSource, Nullable<decimal>>> selector )

Méthodes de typeType Methods

Les opérateurs de requête standard LINQ qui traitent de la conversion et du test des types CLR sont pris en charge dans Entity FrameworkEntity Framework.The LINQ standard query operators that deal with CLR type conversion and testing are supported in the Entity FrameworkEntity Framework. Seuls les types CLR qui sont mappés aux types de modèle conceptuel sont pris en charge dans LINQ to Entities.Only CLR types that map to conceptual model types are supported in LINQ to Entities. Pour obtenir la liste des types de modèle conceptuel, consultez Types de modèle conceptuel (CSDL).For a list of conceptual model types, see Conceptual Model Types (CSDL). Le tableau suivant répertorie les méthodes de type prises en charge et non prises en charge.The following table lists the supported and unsupported type methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
Cast Prise en charge pour les types primitifs EDMSupported for EDM primitive types Function Cast(Of TResult) ( _ source As IQueryable _ ) As IQueryable(Of TResult) IQueryable<TResult> Cast<TResult>( this IQueryable source )
OfType Prise en charge pour EntityTypeSupported for EntityType Function OfType(Of TResult) ( _ source As IQueryable _ ) As IQueryable(Of TResult) IQueryable<TResult> OfType<TResult>( this IQueryable source )

Méthodes de paginationPaging Methods

Certaines méthodes de pagination LINQ ne sont pas prises en charge dans les requêtes LINQ to EntitiesLINQ to Entities.A number of the LINQ paging methods are not supported in LINQ to EntitiesLINQ to Entities queries. Pour plus d’informations, consultez des opérateurs de requête Standard dans les requêtes LINQ to Entities.For more information, see Standard Query Operators in LINQ to Entities Queries. Le tableau suivant répertorie les méthodes de pagination prises en charge et non prises en charge.The following table lists the supported and unsupported paging methods.

MéthodeMethod Prise en chargeSupport Signature de fonction Visual BasicVisual Basic function signature Signature de méthode C#C# method signature
ElementAt Non pris en chargeNot supported Function ElementAt(Of TSource) ( _ source As IQueryable(Of TSource), _ index As Integer _ ) As TSource TSource ElementAt<TSource>( this IQueryable<TSource> source, int index )
ElementAtOrDefault Non pris en chargeNot supported Function ElementAtOrDefault(Of TSource) ( _ source As IQueryable(Of TSource), _ index As Integer _ ) As TSource TSource ElementAtOrDefault<TSource>( this IQueryable<TSource> source, int index )
First Pris en chargeSupported Function First(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource First<TSource>( this IQueryable<TSource> source )
First Pris en chargeSupported Function First(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As TSource TSource First<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
FirstOrDefault Pris en chargeSupported Function FirstOrDefault(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource FirstOrDefault<TSource>( this IQueryable<TSource> source )
FirstOrDefault Pris en chargeSupported Function FirstOrDefault(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As TSource TSource FirstOrDefault<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
Last Non pris en chargeNot supported Function Last(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource Last<TSource>( this IQueryable<TSource> source )
Last Non pris en chargeNot supported Function Last(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As TSource TSource Last<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
LastOrDefault Non pris en chargeNot supported Function LastOrDefault(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource LastOrDefault<TSource>( this IQueryable<TSource> source )
LastOrDefault Non pris en chargeNot supported Function LastOrDefault(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As TSource TSource LastOrDefault<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
Single Pris en chargeSupported Function Single(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource Single<TSource>( this IQueryable<TSource> source )
Single Pris en chargeSupported Function Single(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As TSource TSource Single<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
SingleOrDefault Pris en chargeSupported Function SingleOrDefault(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource TSource SingleOrDefault<TSource>( this IQueryable<TSource> source )
SingleOrDefault Pris en chargeSupported Function SingleOrDefault(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As TSource TSource SingleOrDefault<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
Skip Pris en chargeSupported Function Skip(Of TSource) ( _ source As IQueryable(Of TSource), _ count As Integer _ ) As IQueryable(Of TSource) IQueryable<TSource> Skip<TSource>( this IQueryable<TSource> source, int count )
SkipWhile Non pris en chargeNot supported Function SkipWhile(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As IQueryable(Of TSource) IQueryable<TSource> SkipWhile<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
SkipWhile Non pris en chargeNot supported Function SkipWhile(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Integer, Boolean)) _ ) As IQueryable(Of TSource) IQueryable<TSource> SkipWhile<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, int, bool>> predicate )
Take Pris en chargeSupported Function Take(Of TSource) ( _ source As IQueryable(Of TSource), _ count As Integer _ ) As IQueryable(Of TSource) IQueryable<TSource> Take<TSource>( this IQueryable<TSource> source, int count )
TakeWhile Non pris en chargeNot supported Function TakeWhile(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Boolean)) _ ) As IQueryable(Of TSource) IQueryable<TSource> TakeWhile<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, bool>> predicate )
TakeWhile Non pris en chargeNot supported Function TakeWhile(Of TSource) ( _ source As IQueryable(Of TSource), _ predicate As Expression(Of Func(Of TSource, Integer, Boolean)) _ ) As IQueryable(Of TSource) IQueryable<TSource> TakeWhile<TSource>( this IQueryable<TSource> source, Expression<Func\<TSource, int, bool>> predicate )

Voir aussiSee Also

Opérateurs de requête standard dans les requêtes LINQ to EntitiesStandard Query Operators in LINQ to Entities Queries