共用方式為


聯結方法 (LINQ to Entities)

LINQ 到實體 中支援大部分 LINQ 聯結方法,但接受 IEqualityComparer 者除外,因為比較子無法轉譯成資料來源。如需詳細資訊,請參閱 LINQ to Entities 查詢中的標準查詢運算子。下表所列為支援及不支援的聯結方法。

支援與不支援的方法

方法 支援 Visual Basic 函式簽章 C# 方法簽章

GroupJoin

支援

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

不支援

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

支援

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

不支援

 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
)

另請參閱

概念

支援與不支援的方法 (LINQ to Entities)