The ADO.NET Entity Framework is an extended object relational mapping (ORM) tool from Microsoft that has become increasingly popular over the past few years and is widely used these days. Microsoft designed the ADO.NET Entity Framework to objectify an application's data and simplify the development of data-aware applications. Version 4.0 of the ADO.NET Entity Framework ships with Microsoft Visual Studio 2010 and offers a lot of new and enhanced features.
This article explains the basics of ADO.NET Entity Framework and shows how you can write programs that leverage the generic Object Context.
The Basics of ADO.NET Entity Framework
The first question that comes to one's mind is "What is the ADO.NET Entity Framework?" What is it all about? Well, the ADO.NET Entity Framework (or Entity Framework, as it is popularly called) is an extended ORM development tool from Microsoft that helps you abstract the object model of an application from its relational or logical model. According to MSDN, "The ADO.NET Entity Framework enables developers to create data access applications by programming against a conceptual application model instead of programming directly against a relational storage schema. The goal is to decrease the amount of code and maintenance required for data-oriented applications."
The Entity Framework is comprised of three layers:
- The Conceptual Layer: Represented using CSDL (Conceptual Data Language)
- The Storage Layer: Represented using SSDL (Store-specific Data Language)
- The Mapping Layer: Represented MSL (Mapping Schema Language)
You can use any one of the following to query data exposed by the Entity Data Model, based on its entity relationship model.
- LINQ to entities
- The entity client
- Object services
The primary goal of the Entity Framework was to raise the level of abstraction and simplify development of data-aware applications with reduced effort and reduced KLOC.