語言

DbExpressionBuilder.SelectMany 方法

定義

多載

名稱 Description
SelectMany(DbExpression, Func<DbExpression,DbExpression>)

建立一個新資料 DbApplyExpression ,對給定輸入集合的每個元素評估一次給定的 apply 表達式,產生一組列,並對應輸入與 apply 欄位。 若該列的行會應用於空集合,則不包含在內。 DbProjectExpression接著建立一個從每列選擇 apply 欄位的 apply,產生整體的 apply 結果集合。

SelectMany<TSelector>(DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression,TSelector>)

建立一個新資料 DbApplyExpression ,對給定輸入集合的每個元素評估一次給定的 apply 表達式,產生一組列,並對應輸入與 apply 欄位。 若該列的行會應用於空集合,則不包含在內。 接著建立一個 DbProjectExpression ,在每一列中選擇指定的選擇器,產生整體結果集合。

SelectMany(DbExpression, Func<DbExpression,DbExpression>)

建立一個新資料 DbApplyExpression ,對給定輸入集合的每個元素評估一次給定的 apply 表達式,產生一組列,並對應輸入與 apply 欄位。 若該列的行會應用於空集合,則不包含在內。 DbProjectExpression接著建立一個從每列選擇 apply 欄位的 apply,產生整體的 apply 結果集合。

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

參數

source
DbExpression

A DbExpression 指定輸入集合。

apply
Func<DbExpression,DbExpression>

一種方法,代表對輸入集合中每個成員進行一次評估的邏輯。

傳回

一個新的 DbProjectExpression,從新的 DbApplyExpression 中選擇 apply 欄位,並具備指定的輸入與 apply 綁定,以及 DbExpressionKind CrossApply 的 。

例外狀況

由 apply 產生的表達式為零。

apply 所產生的表達式沒有集合型別。

適用於

SelectMany<TSelector>(DbExpression, Func<DbExpression,DbExpression>, Func<DbExpression,DbExpression,TSelector>)

建立一個新資料 DbApplyExpression ,對給定輸入集合的每個元素評估一次給定的 apply 表達式,產生一組列,並對應輸入與 apply 欄位。 若該列的行會應用於空集合,則不包含在內。 接著建立一個 DbProjectExpression ,在每一列中選擇指定的選擇器,產生整體結果集合。

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

類型參數

TSelector

選擇器的方法結果類型。

參數

source
DbExpression

A DbExpression 指定輸入集合。

apply
Func<DbExpression,DbExpression>

一種方法,代表對輸入集合中每個成員進行一次評估的邏輯。

selector
Func<DbExpression,DbExpression,TSelector>

一種方法,指定在給定輸入元素並應用集合時,如何推導結果集合中的元素。 此方法必須產生一個與 SelectMany 相容且可解析為 DbExpression 的型別實例。 TSelector 的相容性要求詳見備註。

傳回

一個新的 DbProjectExpression,從一個新的 DbApplyExpression 中選擇指定輸入與 apply 綁定,且 CrossApply 的結果 DbExpressionKind 。

例外狀況

選擇器的結果在轉換為 DbExpression 時為 null。

apply 所產生的表達式沒有集合型別。 沒有集合類型。

適用於