Click or drag to resize
MongoQueryableGroupJoinTOuter, TInner, TKey, TResult Method (IMongoQueryableTOuter, IMongoCollectionTInner, ExpressionFuncTOuter, TKey, ExpressionFuncTInner, TKey, ExpressionFuncTOuter, IEnumerableTInner, 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.2.0
public static IMongoQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(
	this IMongoQueryable<TOuter> outer,
	IMongoCollection<TInner> inner,
	Expression<Func<TOuter, TKey>> outerKeySelector,
	Expression<Func<TInner, TKey>> innerKeySelector,
	Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector


Type: MongoDB.Driver.LinqIMongoQueryableTOuter
The first sequence to join.
Type: MongoDB.DriverIMongoCollectionTInner
The collection to join to the first sequence.
Type: System.Linq.ExpressionsExpressionFuncTOuter, TKey
A function to extract the join key from each element of the first sequence.
Type: System.Linq.ExpressionsExpressionFuncTInner, TKey
A function to extract the join key from each element of the second sequence.
Type: System.Linq.ExpressionsExpressionFuncTOuter, IEnumerableTInner, 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

The type of the elements of the first sequence.
The type of the elements of the second sequence.
The type of the keys returned by the key selector functions.
The type of the result elements.

Return Value

Type: IMongoQueryableTResult
An IMongoQueryableT 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 IMongoQueryableTOuter. 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