Skip to content

TQueryLinqExtensions_Join_8FHZDXWvf+MVHzF7O8PxZw

J. Spitzer edited this page Oct 6, 2021 · 2 revisions

TQueryLinqExtensions.Join<TOuter,TInner,TKey,TResult>(TQueryable<TOuter>, TQueryable<TInner>, Expression<Func<TOuter,TKey>>, Expression<Func<TInner,TKey>>, Expression<Func<TOuter,TInner,TResult>>, JoinType) Method

Correlates the records of two TQuery recordsets based on matching keys.

public static Dapper.TQuery.TQueryable<TResult> Join<TOuter,TInner,TKey,TResult>(this Dapper.TQuery.TQueryable<TOuter> outer, Dapper.TQuery.TQueryable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter,TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner,TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter,TInner,TResult>> resultSelector, Dapper.TQuery.JoinType joinType=Dapper.TQuery.JoinType.InnerJoin);

Type parameters

TOuter
The table type of the records of the first table.

TInner
The table type of the records of the second/joined table.

TKey
The type of the keys returned by the key selector functions.

TResult
The type of the result records.

Parameters

outer Dapper.TQuery.TQueryable<TOuter>
The first TQueryable<T> TQuery recordset to join.

inner Dapper.TQuery.TQueryable<TInner>
The second TQueryable<T> TQuery recordset to join to the first TQuery recordset.

outerKeySelector System.Linq.Expressions.Expression<System.Func<TOuter,TKey>>
A function to extract the join key from each record of the first recordset.

innerKeySelector System.Linq.Expressions.Expression<System.Func<TInner,TKey>>
A function to extract the join key from each record of the second recordset.

resultSelector System.Linq.Expressions.Expression<System.Func<TOuter,TInner,TResult>>
A function to create a result record from two joined table records.

joinType JoinType
A join type selected by the Dapper.TQuery.JoinType enum. Available options: InnerJoin, LeftJoin, RightJoin, FullJoin. If no option is selected, The default will be InnerJoin.

Returns

Dapper.TQuery.TQueryable<TResult>
An TQueryable<T> that has records of type TResult obtained by performing an inner join on two TQuery recordsets.

Clone this wiki locally