共用方式為


DbExpressionBuilder.CrossApply 方法 (DbExpression, Func<DbExpression, KeyValuePair<String, DbExpression>>)

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

建立新的 DbApplyExpression,它會針對給定輸入集的每個項目評估給定的 apply 運算式一次,以產生具有對應的輸入和套用資料行的資料列集合。 其中不包含 apply 評估為空集合的資料列。

命名空間:  System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
<ExtensionAttribute> _
Public Shared Function CrossApply ( _
    source As DbExpression, _
    apply As Func(Of DbExpression, KeyValuePair(Of String, DbExpression)) _
) As DbApplyExpression
'用途
Dim source As DbExpression 
Dim apply As Func(Of DbExpression, KeyValuePair(Of String, DbExpression))
Dim returnValue As DbApplyExpression 

returnValue = source.CrossApply(apply)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static DbApplyExpression CrossApply(
    this DbExpression source,
    Func<DbExpression, KeyValuePair<string, DbExpression>> apply
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
public:
static DbApplyExpression^ CrossApply(
    DbExpression^ source, 
    Func<DbExpression^, KeyValuePair<String^, DbExpression^>>^ apply
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
static member CrossApply : 
        source:DbExpression * 
        apply:Func<DbExpression, KeyValuePair<string, DbExpression>> -> DbApplyExpression
public static function CrossApply(
    source : DbExpression, 
    apply : Func<DbExpression, KeyValuePair<String, DbExpression>>
) : DbApplyExpression

參數

傳回值

類型:System.Data.Entity.Core.Common.CommandTrees.DbApplyExpression
具有指定輸入及套用繫結與 CrossApply 之 DbExpressionKind 的新 DbApplyExpression。

使用注意事項

在 Visual Basic 和 C# 中,您可以在任何 DbExpression 類型物件中呼叫這個方法以做為執行個體。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱 https://msdn.microsoft.com/zh-tw/library/bb384936(v=vs.113)https://msdn.microsoft.com/zh-tw/library/bb383977(v=vs.113)

例外狀況

例外狀況 條件
ArgumentNullException

source 或 apply 為 null。

ArgumentException

source 沒有集合結果類型。

ArgumentNullException

apply 的結果包含為 null 的名稱或運算式。

ArgumentException

apply 的結果包含的名稱或運算式在運算式繫結中無效。

請參閱

參考

DbExpressionBuilder 類別

CrossApply 多載

System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder 命名空間