DbExpressionBuilder.SelectMany 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
SelectMany(DbExpression, Func<DbExpression,DbExpression>) |
Creates a new DbApplyExpression that evaluates the given apply expression once for each element of a given input set, producing a collection of rows with corresponding input and apply columns. Rows for which apply evaluates to an empty set are not included. A DbProjectExpression is then created that selects the apply column from each row, producing the overall collection of apply results. |
SelectMany<TSelector>(DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression,TSelector>) |
Creates a new DbApplyExpression that evaluates the given apply expression once for each element of a given input set, producing a collection of rows with corresponding input and apply columns. Rows for which apply evaluates to an empty set are not included. A DbProjectExpression is then created that selects the specified selector over each row, producing the overall collection of results. |
SelectMany(DbExpression, Func<DbExpression,DbExpression>)
Creates a new DbApplyExpression that evaluates the given apply expression once for each element of a given input set, producing a collection of rows with corresponding input and apply columns. Rows for which apply evaluates to an empty set are not included. A DbProjectExpression is then created that selects the apply column from each row, producing the overall collection of apply results.
public static System.Data.Entity.Core.Common.CommandTrees.DbProjectExpression SelectMany (this System.Data.Entity.Core.Common.CommandTrees.DbExpression source, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> apply);
static member SelectMany : 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.DbProjectExpression
<Extension()>
Public Function SelectMany (source As DbExpression, apply As Func(Of DbExpression, DbExpression)) As DbProjectExpression
Parameters
- source
- DbExpression
A DbExpression that specifies the input set.
- apply
- Func<DbExpression,DbExpression>
A method that represents the logic to evaluate once for each member of the input set.
Returns
An new DbProjectExpression that selects the apply column from a new DbApplyExpression with the specified input and apply bindings and an DbExpressionKind of CrossApply.
Exceptions
The expression produced by apply is null.
The expression produced by apply does not have a collection type.
Applies to
SelectMany<TSelector>(DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression,TSelector>)
Creates a new DbApplyExpression that evaluates the given apply expression once for each element of a given input set, producing a collection of rows with corresponding input and apply columns. Rows for which apply evaluates to an empty set are not included. A DbProjectExpression is then created that selects the specified selector over each row, producing the overall collection of results.
public static System.Data.Entity.Core.Common.CommandTrees.DbProjectExpression SelectMany<TSelector> (this System.Data.Entity.Core.Common.CommandTrees.DbExpression source, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> apply, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression,TSelector> selector);
static member SelectMany : 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 SelectMany(Of TSelector) (source As DbExpression, apply As Func(Of DbExpression, DbExpression), selector As Func(Of DbExpression, DbExpression, TSelector)) As DbProjectExpression
Type Parameters
- TSelector
The method result type of selector.
Parameters
- source
- DbExpression
A DbExpression that specifies the input set.
- apply
- Func<DbExpression,DbExpression>
A method that represents the logic to evaluate once for each member of the input set.
- selector
- Func<DbExpression,DbExpression,TSelector>
A method that specifies how an element of the result set should be derived given an element of the input and apply sets. This method must produce an instance of a type that is compatible with SelectMany and can be resolved into a DbExpression . Compatibility requirements for TSelector are described in remarks.
Returns
An new DbProjectExpression that selects the result of the given selector from a new DbApplyExpression with the specified input and apply bindings and an DbExpressionKind of CrossApply.
Exceptions
The result of selector is null on conversion to DbExpression.
The expression produced by apply does not have a collection type. does not have a collection type.
Applies to
Entity Framework