共用方式為


Entity SQL Overview

Entity SQL is similar to the Transact-SQL language, and it is provided by the ADO.NET Entity Framework to support the Entity Data Model (EDM). The EDM represents application data as a set of entities and relationships that are mapped to a defined data source. Entity SQL supports EDM constructs, enabling users to effectively query the data represented by an entity model. For information about the EDM, see Entity Data Model.

The Entity Framework works with storage-specific data providers to translate generic Entity SQL into storage-specific queries. The EntityClient provider supplies a way to execute an Entity SQL command against an entity model and return rich types of data including scalar results, result sets, and object graphs. When you construct EntityCommand objects, you can specify a stored procedure name or the text of a query by assigning an Entity SQL query string to its System.Data.EntityClient.EntityCommand.CommandText property. The EntityDataReader exposes the results of executing a EntityCommand against an EDM. To execute the command that returns the EntityDataReader, call ExecuteReader. For more information, see Working with EntityClient (Entity Framework Tasks).

In addition to the EntityClient provider, Object Services enables you to use Entity SQL to execute queries against an Entity Data Model and return data as strongly-typed CLR objects that are instances of entity types. For more information, see Object Services (Entity Framework).

This section provides conceptual information about Entity SQL.

In This Section

  • Type System (Entity SQL)
    Discusses the anonymous types that are not defined in the schema explicitly but are supported by Entity SQL.
  • Query Expressions (Entity SQL)
    Provides information about query expression. It combines together many different query operators into a single syntax.
  • Paging (Entity SQL)
    Describes physical paging that can be performed by using SKIP and LIIMIT sub-clauses in ORDER BY clause.

See Also

Concepts

Entity SQL Language

Other Resources

Schemas and Mapping Specification (Entity Framework)