Entity SQL Language
Entity SQL is a storage-independent query language that is similar to SQL. Entity SQL allows you to query entity data, either as objects or in a tabular form. You should consider using Entity SQL in the following cases:
-
When a query must be dynamically constructed at runtime. In this case, you should also consider using the query builder methods of ObjectQuery instead of constructing an Entity SQL query string at runtime.
-
When you want to define a query as part of the model definition. Only Entity SQL is supported in a data model. For more information, see QueryView Element (EntitySetMapping)
-
When using EntityClient to return read-only entity data as rowsets using a EntityDataReader. For more information, see EntityClient Provider for the Entity Framework.
-
If you are already an expert in SQL-based query languages, Entity SQL may seem the most natural to you.
Using Entity SQL with the EntityClient provider
If you want to use Entity SQL with the EntityClient provider, see the following topics for more information:
EntityClient Provider for the Entity Framework
How to: Build an EntityConnection Connection String
How to: Execute a Query that Returns PrimitiveType Results
How to: Execute a Query that Returns StructuralType Results
How to: Execute a Query that Returns RefType Results
How to: Execute a Query that Returns Complex Types
How to: Execute a Query that Returns Nested Collections
How to: Execute a Parameterized Entity SQL Query Using EntityCommand
How to: Execute a Parameterized Stored Procedure Using EntityCommand
Using Entity SQL with object queries
If you want to use Entity SQL with object queries, see the following topics for more information:
How to: Execute a Query that Returns an Entity Type (Entity Framework)
How to: Execute a Parameterized Query (Entity Framework)
How to: Navigate Relationships Using Navigation Properties (Entity Framework)
How to: Call a User-Defined Function (Entity Framework)
How to: Filter Data (Entity Framework)
How to: Sort Data (Entity Framework)
How to: Group Data (Entity Framework)
How to: Aggregate Data (Entity Framework)
How to: Execute a Query that Returns an Anonymous Type (Entity Framework)
How to: Execute a Query that Returns a Primitive Type (Entity Framework)
How to: Query Related Objects in an EntityCollection (Entity Framework)
In This Section
See Also
Build Date: