Click or drag to resize

MongoQueryableJoinTOuter, TInner, TKey, TResult Method (IMongoQueryableTOuter, IMongoCollectionTInner, ExpressionFuncTOuter, TKey, ExpressionFuncTInner, TKey, ExpressionFuncTOuter, TInner, TResult)

Correlates the elements of two sequences based on matching keys.

Namespace:  MongoDB.Driver.Linq
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.9.0+32b058abcdf2c7e8d9dd3a676d207b31897eee2e
Syntax
public static IMongoQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(
	this IMongoQueryable<TOuter> outer,
	IMongoCollection<TInner> inner,
	Expression<Func<TOuter, TKey>> outerKeySelector,
	Expression<Func<TInner, TKey>> innerKeySelector,
	Expression<Func<TOuter, TInner, TResult>> resultSelector
)

Parameters

outer
Type: MongoDB.Driver.LinqIMongoQueryableTOuter
The first sequence to join.
inner
Type: MongoDB.DriverIMongoCollectionTInner
The sequence to join to the first sequence.
outerKeySelector
Type: System.Linq.ExpressionsExpressionFuncTOuter, TKey
A function to extract the join key from each element of the first sequence.
innerKeySelector
Type: System.Linq.ExpressionsExpressionFuncTInner, TKey
A function to extract the join key from each element of the second sequence.
resultSelector
Type: System.Linq.ExpressionsExpressionFuncTOuter, TInner, TResult
A function to create a result element from two matching elements.

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: IMongoQueryableTResult
An IQueryableT that has elements of type TResult obtained by performing an inner 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