Partilhar via


Calling Functions in LINQ to Entities Queries

The topics in this section describe how to call functions in LINQ to Entities queries.

The EntityFunctions and SqlFunctions classes provide access to canonical and database functions as part of the Entity Framework. For more information, see How to: Call Canonical Functions and How to: Call Database Functions.

The process for calling a custom function requires three basic steps:

  1. Define a function in your conceptual model or declare a function in your storage model.

  2. Add a method to your application and map it to the function in the model with an EdmFunctionAttribute.

  3. Call the function in a LINQ to Entities query.

For more information, see the topics in this section.

In This Section

How to: Call Canonical Functions

How to: Call Database Functions

How to: Call Custom Database Functions

How to: Call Model-Defined Functions in Queries

How to: Call Model-Defined Functions as Object Methods

See Also

Concepts

Queries in LINQ to Entities
Canonical Functions

Other Resources

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