MongoQueryable.GroupJoin<TOuter, TInner, TKey, TResult> Method (IMongoQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>) |
Correlates the elements of two sequences based on key equality and groups the results.
Namespace:
MongoDB.Driver.Linq
Assembly:
MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.14.0+2b37a1fe1cbdbe1a020b52b77f1197b6d77575e7
Syntax public static IMongoQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(
this IMongoQueryable<TOuter> outer,
IEnumerable<TInner> inner,
Expression<Func<TOuter, TKey>> outerKeySelector,
Expression<Func<TInner, TKey>> innerKeySelector,
Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector
)
<ExtensionAttribute>
Public Shared Function GroupJoin(Of TOuter, TInner, TKey, TResult) (
outer As IMongoQueryable(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 IMongoQueryable(Of TResult)
[<ExtensionAttribute>]
static member GroupJoin :
outer : IMongoQueryable<'TOuter> *
inner : IEnumerable<'TInner> *
outerKeySelector : Expression<Func<'TOuter, 'TKey>> *
innerKeySelector : Expression<Func<'TInner, 'TKey>> *
resultSelector : Expression<Func<'TOuter, IEnumerable<'TInner>, 'TResult>> -> IMongoQueryable<'TResult>
Parameters
- outer
- Type: MongoDB.Driver.Linq.IMongoQueryable<TOuter>
The first sequence to join. - inner
- Type: System.Collections.Generic.IEnumerable<TInner>
The sequence to join to the first sequence. - outerKeySelector
- Type: System.Linq.Expressions.Expression<Func<TOuter, TKey>>
A function to extract the join key from each element of the first sequence. - innerKeySelector
- Type: System.Linq.Expressions.Expression<Func<TInner, TKey>>
A function to extract the join key from each element of the second sequence. - resultSelector
- Type: System.Linq.Expressions.Expression<Func<TOuter, IEnumerable<TInner>, TResult>>
A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.
Type Parameters
- TOuter
- The type of the elements of the first sequence.
- TInner
- The type of the elements of the second sequence.
- TKey
- The type of the keys returned by the key selector functions.
- TResult
- The type of the result elements.
Return Value
Type:
IMongoQueryable<TResult>
An
IMongoQueryable<T> that contains elements of type
TResult obtained by performing a grouped join on two sequences.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IMongoQueryable<TOuter>. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also