DbExpressionBuilder.Join Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Join(DbExpression, DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression>) |
Creates a new DbJoinExpression that joins the sets specified by the outer and inner expressions, on an equality condition between the specified outer and inner keys, using InnerJoin as the DbExpressionKind . |
Join<TSelector>(DbExpression, DbExpression, Func<DbExpression, DbExpression>, Func<DbExpression,DbExpression>, Func<DbExpression, DbExpression,TSelector>) |
Creates a new DbProjectExpression that projects the specified selector over the sets specified by the outer and inner expressions, joined on an equality condition between the specified outer and inner keys, using InnerJoin as the DbExpressionKind . |
Join(DbExpression, DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression>)
Creates a new DbJoinExpression that joins the sets specified by the outer and inner expressions, on an equality condition between the specified outer and inner keys, using InnerJoin as the DbExpressionKind .
public static System.Data.Entity.Core.Common.CommandTrees.DbJoinExpression Join (this System.Data.Entity.Core.Common.CommandTrees.DbExpression outer, System.Data.Entity.Core.Common.CommandTrees.DbExpression inner, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> outerKey, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> innerKey);
static member Join : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Common.CommandTrees.DbExpression * Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression, System.Data.Entity.Core.Common.CommandTrees.DbExpression> * Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression, System.Data.Entity.Core.Common.CommandTrees.DbExpression> -> System.Data.Entity.Core.Common.CommandTrees.DbJoinExpression
<Extension()>
Public Function Join (outer As DbExpression, inner As DbExpression, outerKey As Func(Of DbExpression, DbExpression), innerKey As Func(Of DbExpression, DbExpression)) As DbJoinExpression
Parameters
- outer
- DbExpression
A DbExpression that specifies the outer set argument.
- inner
- DbExpression
A DbExpression that specifies the inner set argument.
- outerKey
- Func<DbExpression,DbExpression>
A method that specifies how the outer key value should be derived from an element of the outer set.
- innerKey
- Func<DbExpression,DbExpression>
A method that specifies how the inner key value should be derived from an element of the inner set.
Returns
A new DbJoinExpression, with an DbExpressionKind of InnerJoin, that represents the inner join operation applied to the left and right input sets under a join condition that compares the outer and inner key values for equality.
Exceptions
The expression produced by outerKey or innerKey is null.
The expressions produced by outerKey and innerKey are not comparable for equality.
Applies to
Join<TSelector>(DbExpression, DbExpression, Func<DbExpression, DbExpression>, Func<DbExpression,DbExpression>, Func<DbExpression, DbExpression,TSelector>)
Creates a new DbProjectExpression that projects the specified selector over the sets specified by the outer and inner expressions, joined on an equality condition between the specified outer and inner keys, using InnerJoin as the DbExpressionKind .
public static System.Data.Entity.Core.Common.CommandTrees.DbProjectExpression Join<TSelector> (this System.Data.Entity.Core.Common.CommandTrees.DbExpression outer, System.Data.Entity.Core.Common.CommandTrees.DbExpression inner, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> outerKey, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> innerKey, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression,TSelector> selector);
static member Join : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Common.CommandTrees.DbExpression * Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression, System.Data.Entity.Core.Common.CommandTrees.DbExpression> * Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression, System.Data.Entity.Core.Common.CommandTrees.DbExpression> * Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression, System.Data.Entity.Core.Common.CommandTrees.DbExpression, 'Selector> -> System.Data.Entity.Core.Common.CommandTrees.DbProjectExpression
<Extension()>
Public Function Join(Of TSelector) (outer As DbExpression, inner As DbExpression, outerKey As Func(Of DbExpression, DbExpression), innerKey As Func(Of DbExpression, DbExpression), selector As Func(Of DbExpression, DbExpression, TSelector)) As DbProjectExpression
Type Parameters
- TSelector
The type of the selector .
Parameters
- outer
- DbExpression
A DbExpression that specifies the outer set argument.
- inner
- DbExpression
A DbExpression that specifies the inner set argument.
- outerKey
- Func<DbExpression,DbExpression>
A method that specifies how the outer key value should be derived from an element of the outer set.
- innerKey
- Func<DbExpression,DbExpression>
A method that specifies how the inner key value should be derived from an element of the inner set.
- selector
- Func<DbExpression,DbExpression,TSelector>
A method that specifies how an element of the result set should be derived from elements of the inner and outer sets. This method must produce an instance of a type that is compatible with Join and can be resolved into a DbExpression . Compatibility requirements for TSelector are described in remarks.
Returns
A new DbProjectExpression with the specified selector as its projection, and a new DbJoinExpression as its input. The input DbJoinExpression is created with an DbExpressionKind of InnerJoin, that represents the inner join operation applied to the left and right input sets under a join condition that compares the outer and inner key values for equality.
Exceptions
The result of selector is null after conversion to DbExpression.
The result of Selector is not compatible with SelectMany.
Applies to
Entity Framework