呼叫 LINQ to Entities 查詢中的函式

本章節的主題描述如何使用呼叫 LINQ to Entities 查詢中的函式。

EntityFunctionsSqlFunctions 類別可讓您存取標準函式與資料庫函式,這些函式是 Entity Framework 的一部分。 如需詳細資訊,請見HOW TO:呼叫標準函式 (LINQ to Entities)HOW TO:呼叫資料庫函式 (LINQ to Entities)

呼叫自訂函式的程序需要三個基本步驟:

  1. 定義概念模型中的函式或宣告儲存模型中的函式。

  2. 使用 EdmFunctionAttribute 將方法加入至應用程式,並將它對應至模型中的函式。

  3. 呼叫 LINQ to Entities 查詢中的函式。

如需詳細資料,請參閱本節中的主題。

本節內容

HOW TO:呼叫標準函式 (LINQ to Entities)

HOW TO:呼叫資料庫函式 (LINQ to Entities)

HOW TO:呼叫自訂資料庫函式 (LINQ to Entities)

HOW TO:在查詢中呼叫模型定義函式 (LINQ to Entities)

HOW TO:呼叫模型定義函式做為物件方法 (LINQ to Entities)

另請參閱

概念

LINQ to Entities 中的查詢
標準函式 (Entity SQL)

其他資源

.edmx File Overview
How to: Define Custom Functions in the Conceptual Model