Unterstützte und nicht unterstützte LINQ-Methoden (LINQ to Entities)
In diesem Abschnitt werden Informationen über die Language-Integrated Query (LINQ)-Standardabfrageoperatoren bereitgestellt, die in LINQ to Entities-Abfragen unterstützt bzw. nicht unterstützt werden. Viele der LINQ-Standardabfrageoperatoren verfügen über eine überladene Version, der ein ganzzahliges Argument übergeben werden kann. Das ganzzahlige Argument entspricht einem nullbasierten Index in der bearbeiteten Sequenz, einem IEqualityComparer<T> oder IComparer<T>. Sofern nicht anders angegeben, werden diese überladenen Versionen der LINQ-Standardabfrageoperatoren nicht unterstützt, und bei ihrer Verwendung wird eine Ausnahme ausgelöst.
Projektions- und Einschränkungsmethoden
Die meisten Methoden zur Projektion und Einschränkung von LINQ werden in LINQ to Entities-Abfragen unterstützt. Davon ausgenommen sind die Methoden, denen positionelle Argumente übergeben werden. Weitere Informationen finden Sie unter Standardabfrageoperatoren in LINQ to Entities-Abfragen. In der folgenden Tabelle sind die unterstützten und nicht unterstützten Projektions- und Einschränkungsmethoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
Select | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 ) |
Methoden zur Verknüpfung
Die LINQ-Joinmethoden werden in LINQ to Entities unterstützt. Davon ausgenommen sind die Methoden, denen ein IEqualityComparer
übergeben wird, da der Vergleich nicht für die Datenquelle übersetzt werden kann. Weitere Informationen finden Sie unter Standardabfrageoperatoren in LINQ to Entities-Abfragen. In der folgenden Tabelle sind die unterstützten und nicht unterstützten Joinmethoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
GroupJoin | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 ) |
Methoden für Mengen
Die meisten LINQ-Set-Methoden werden in LINQ to Entities unterstützt. Davon ausgenommen sind Methoden, die einen EqualityComparer<T> verwenden. Weitere Informationen finden Sie unter Standardabfrageoperatoren in LINQ to Entities-Abfragen. In der folgenden Tabelle sind die unterstützten und nicht unterstützten Set-Methoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
All | Unterstützt | 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 | Unterstützt | Function Any(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As Boolean |
bool Any<TSource>( this IQueryable<TSource> source ) |
Any | Unterstützt | 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 | Unterstützt | Function Contains(Of TSource) ( _ source As IQueryable(Of TSource), _ item As TSource _ ) As Boolean |
bool Contains<TSource>( this IQueryable<TSource> source, TSource item ) |
Contains | Nicht unterstützt | 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 | Unterstützt, allerdings wird die Beibehaltung der Reihenfolge nicht gewährleistet |
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 | Unterstützt | Function DefaultIfEmpty(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As IQueryable(Of TSource) |
IQueryable<TSource> DefaultIfEmpty<TSource>( this IQueryable<TSource> source ) |
DefaultIfEmpty | Unterstützt | 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 | Unterstützt | Function Distinct(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As IQueryable(Of TSource) |
IQueryable<TSource> Distinct<TSource>( this IQueryable<TSource> source ) |
Distinct | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 ) |
Sortiermethoden
Die meisten der LINQ-Sortiermethoden werden in LINQ to Entities unterstützt. Davon ausgenommen sind die Methoden, denen ein IComparer<T> übergeben wird, da der Vergleich nicht für die Datenquelle übersetzt werden kann. Weitere Informationen finden Sie unter Standardabfrageoperatoren in LINQ to Entities-Abfragen. In der folgenden Tabelle sind die unterstützten und nicht unterstützten Sortierungsmethoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
OrderBy | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | Function Reverse(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As IQueryable(Of TSource) |
IQueryable<TSource> Reverse<TSource>( this IQueryable<TSource> source ) |
Gruppierungsmethoden
Die meisten der LINQ-Gruppierungsmethoden werden in LINQ to Entities unterstützt. Davon ausgenommen sind die Methoden, denen ein IEqualityComparer<T> übergeben wird, da der Vergleich nicht für die Datenquelle übersetzt werden kann. Weitere Informationen finden Sie unter Standardabfrageoperatoren in LINQ to Entities-Abfragen. In der folgenden Tabelle sind die unterstützten und nicht unterstützten Gruppierungsmethoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
GroupBy | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 ) |
Aggregatmethoden
Die meisten Aggregatmethoden, denen primitive Datentypen übergeben werden, werden in LINQ to Entities unterstützt. Weitere Informationen finden Sie unter Standardabfrageoperatoren in LINQ to Entities-Abfragen. In der folgenden Tabelle sind die unterstützten und nicht unterstützten Aggregationsmethoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
Aggregate | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | Function Average ( _ source As IQueryable(Of Decimal) _ ) As Decimal |
decimal Average( this IQueryable<decimal> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Double) _ ) As Double |
double Average( this IQueryable<double> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Integer) _ ) As Double |
double Average( this IQueryable<int> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Long) _ ) As Double |
double Average( this IQueryable<long> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Nullable(Of Decimal)) _ ) As Nullable(Of Decimal) |
Nullable<decimal> Average( this IQueryable<Nullable<decimal>> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Nullable(Of Double)) _ ) As Nullable(Of Double) |
Nullable<double> Average( this IQueryable<Nullable<double>> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Nullable(Of Integer)) _ ) As Nullable(Of Double) |
Nullable<double> Average( this IQueryable<Nullable<int>> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Nullable(Of Long)) _ ) As Nullable(Of Double) |
Nullable<double> Average( this IQueryable<Nullable<long>> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Nullable(Of Single)) _ ) As Nullable(Of Single) |
Nullable<float> Average( this IQueryable<Nullable<float>> source ) |
Average | Unterstützt | Function Average ( _ source As IQueryable(Of Single) _ ) As Single |
float Average( this IQueryable<float> source ) |
Average | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | Function Count(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As Integer |
int Count<TSource>( this IQueryable<TSource> source ) |
Count | Nicht unterstützt | 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 | Unterstützt | Function LongCount(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As Long |
long LongCount<TSource>( this IQueryable<TSource> source ) |
LongCount | Nicht unterstützt | 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 | Unterstützt | Function Max(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource Max<TSource>( this IQueryable<TSource> source ) |
Max | Nicht unterstützt | 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 | Unterstützt | Function Min(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource Min<TSource>( this IQueryable<TSource> source ) |
Min | Nicht unterstützt | 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 | Unterstützt | Function Sum ( _ source As IQueryable(Of Decimal) _ ) As Decimal |
decimal Sum( this IQueryable<decimal> source ) |
Sum | Unterstützt | Function Sum ( _ source As IQueryable(Of Double) _ ) As Double |
double Sum( this IQueryable<double> source |
Sum | Unterstützt | Function Sum ( _ source As IQueryable(Of Integer) _ ) As Integer |
int Sum( this IQueryable<int> source ) |
Sum | Unterstützt | Function Sum ( _ source As IQueryable(Of Long) _ ) As Long |
long Sum( this IQueryable<long> source ) |
Sum | Unterstützt | Function Sum ( _ source As IQueryable(Of Nullable(Of Decimal)) _ ) As Nullable(Of Decimal) |
Nullable<decimal> Sum( this IQueryable<Nullable<decimal>> source ) |
Sum | Unterstützt | 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 | Unterstützt | Function Sum ( _ source As IQueryable(Of Nullable(Of Integer)) _ ) As Nullable(Of Integer) |
Nullable<int> Sum( this IQueryable<Nullable<int>> source ) |
Sum | Unterstützt | Function Sum ( _ source As IQueryable(Of Nullable(Of Long)) _ ) As Nullable(Of Long) |
Nullable<long> Sum( this IQueryable<Nullable<long>> source ) |
Sum | Unterstützt | Function Sum ( _ source As IQueryable(Of Nullable(Of Single)) _ ) As Nullable(Of Single) |
Nullable<float> Sum( this IQueryable<Nullable<float>> source ) |
Sum | Unterstützt | Function Sum ( _ source As IQueryable(Of Single) _ ) As Single |
float Sum( this IQueryable<float> source ) |
Sum | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 ) |
Typmethoden
Die LINQ-Standardabfrageoperatoren, die mit CLR-Typkonvertierung und Testen zusammenhängen, werden im Entity Framework unterstützt. Nur CLR-Typen, die den konzeptionellen Modelltypen zugeordnet werden, werden in LINQ to Entities unterstützt. Eine Liste der konzeptionellen Modelltypen finden Sie unter Konzeptionelle Modelltypen (CSDL). In der folgenden Tabelle sind die unterstützten und nicht unterstützten Typmethoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
Cast | Unterstützt für primitive Typen des EDM | Function Cast(Of TResult) ( _ source As IQueryable _ ) As IQueryable(Of TResult) |
IQueryable<TResult> Cast<TResult>( this IQueryable source ) |
OfType | Unterstützt für EntityType | Function OfType(Of TResult) ( _ source As IQueryable _ ) As IQueryable(Of TResult) |
IQueryable<TResult> OfType<TResult>( this IQueryable source ) |
Pagingmethoden
Eine Reihe der LINQ-Pagingmethoden wird in LINQ to Entities-Abfragen nicht unterstützt. Weitere Informationen finden Sie unter Standardabfrageoperatoren in LINQ to Entities-Abfragen. In der folgenden Tabelle sind die unterstützten und nicht unterstützten Pagingmethoden aufgeführt.
Methode | Support | Visual Basic-Funktionssignatur | C#-Methodensignatur |
---|---|---|---|
ElementAt | Nicht unterstützt | Function ElementAt(Of TSource) ( _ source As IQueryable(Of TSource), _ index As Integer _ ) As TSource |
TSource ElementAt<TSource>( this IQueryable<TSource> source, int index ) |
ElementAtOrDefault | Nicht unterstützt | Function ElementAtOrDefault(Of TSource) ( _ source As IQueryable(Of TSource), _ index As Integer _ ) As TSource |
TSource ElementAtOrDefault<TSource>( this IQueryable<TSource> source, int index ) |
First | Unterstützt | Function First(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource First<TSource>( this IQueryable<TSource> source ) |
First | Unterstützt | 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 | Unterstützt | Function FirstOrDefault(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource FirstOrDefault<TSource>( this IQueryable<TSource> source ) |
FirstOrDefault | Unterstützt | 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 | Nicht unterstützt | Function Last(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource Last<TSource>( this IQueryable<TSource> source ) |
Last | Nicht unterstützt | 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 | Nicht unterstützt | Function LastOrDefault(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource LastOrDefault<TSource>( this IQueryable<TSource> source ) |
LastOrDefault | Nicht unterstützt | 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 | Unterstützt | Function Single(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource Single<TSource>( this IQueryable<TSource> source ) |
Single | Unterstützt | 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 | Unterstützt | Function SingleOrDefault(Of TSource) ( _ source As IQueryable(Of TSource) _ ) As TSource |
TSource SingleOrDefault<TSource>( this IQueryable<TSource> source ) |
SingleOrDefault | Unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 | Unterstützt | 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 | Nicht unterstützt | 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 | Nicht unterstützt | 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 ) |