There are different types of Queries supported by Entity Framework.
Queries
LINQ to Entity
Entity SQL
Native SQL
All these query types are converted into SQL.
LINQ to Entity
Description
LINQ means Language Integrated Query. LINQ is one of the tools which is used to query the data from the database. LINQ to Entity means LINQ is used in Entities to access the data from the database.
Types of Syntax
Method Syntax
Query Syntax
Both the syntax uses using() method to initialize an object. If the Object scope going to expire then the dispose() method will be automatically called.
Note
In LINQ to Entity, context will return IQueryable.
Example
See the below Normal SQL Query.
[sql]select * from Name.Employee where DepartmentId=1[/sql]
Query Expression for above SQL Query.
[sql]from e in employee where e.DepartmentId=1 select e[/sql]
Method Syntax for the above SQL Query.
[sql]employee.where(e=>e.DepartmentId==1)[/sql]
Entity SQL
Description
Entity SQL is also one of the types of tools in the Entity Framework which is used to query the data.
Entity SQL totally works by Object Services.