LINQ to Entities

For LINQ to SQL, another product that you will want to compare it with is the .NET Entity Framework. Before comparing LINQ to SQL with Entity Framework, let's first explain what Entity Framework is.

ADO.NET Entity Framework (EF) was first released with Visual Studio 2008 and .NET framework 3.5 Service Pack 1. So far, many people view EF as just another ORM product from Microsoft, although by design, it is supposed to be much more powerful than just an ORM tool.

With Entity Framework, developers work with a conceptual data model an Entity Data Model, or EDM —instead of the underlying databases. The conceptual data model schema is expressed in the Conceptual Schema Definition Language (CSDL), the actual storage model is expressed in the Storage Schema Definition Language (SSDL), and the mapping between the two is expressed in the Mapping Schema Language (MSL). A new data-access provider, EntityClient, is created for this new framework. But under the hood, the ADO.NET data providers are still being used to communicate with the databases. The following diagram, which has been taken from the July 2008 issue of the MSDN Magazine, shows the architecture of Entity Framework:

LINQ to Entities

From the diagram, you can see that LINQ is one of the query languages that can be used to query against Entity Framework Entities. LINQ to Entities allows developers to create flexible, strongly-typed queries against the Entity Data Model (EDM) by using LINQ expressions and standard LINQ query operators. This is just the same as what LINQ to SQL can do, although LINQ to Entities supports more features than LINQ to SQL, such as multiple-table inheritance, and it also supports many other mainstream RDBMS databases such as Oracle, DB2, and MySQL in addition to Microsoft SQL Server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset