Your SlideShare is downloading. ×
  • Like
Intro to entity framework
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Intro to entity framework

  • 57 views
Published

 

Published in Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
57
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
3
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Entity Framework
  • 2. What Is the Entity Framework? • The Entity Framework is a set of technologies in ADO.NET that helps fill in the space between object oriented development (objects) and databases. • This gap is commonly known as an “impedance mismatch” and it exists because the mapping and organization of classes does not quite match up to the organization of relational objects.
  • 3. What Is the Entity Framework?(cont.) • It generates business objects and entities according to the database tables and provides the mechanism for: 1. Performing basic CRUD (Create, Read, Update, Delete) operations. 2. Easily managing "1 to 1", "1 to many", and "many to many" relationships. 3. Ability to have inheritance relationships between entities.
  • 4. What are the benefits of using it? 1. We can have all data access logic written in higher level languages. 2. The conceptual model can be represented in a better way by using relationships among entities. 3. The underlying data store can be replaced without much overhead since all data access logic is present at a higher level.
  • 5. Is it an alternative to ADO.NET? • Yes because the developer will not be writing ADO.NET methods and classes for performing data operations. • No because this model is actually written on top of ADO.NET, meaning under this framework, we are still using ADO.NET.
  • 6. The Entity Framework Architecture Application ORM Interface Entity Framework Entity Data Model (EDM) Describe Object Relational Mapping ADO .NET Provider Data Store
  • 7. Entity Data Model • The Entity Data Model (EDM) is the foundation of the Entity Framework and is comprised of the three Layers • These three layers allow data to be mapped from a relational database to a more object-oriented business model. • ADO.NET EF 3.5 defines these layers using XML files. These XML files provide a level of abstraction so developers can program against the OO conceptual model instead of the traditional relational data model.
  • 8. Entity Data Model(Cont.) • The conceptual Layer: Is defined in an XML file using Conceptual Schema Definition Language (CSDL). CSDL defines the entities and the relationships as the application’s business layer knows them. • The Storage (logical) Layer: Which represents the database schema, is defined in an XML file using Store Schema Definition Language (SSDL) • The Mapping Layer: Which is defined using Mapping Schema Language (MSL), maps the other two layers. This mapping is what allows developers to code against the conceptual model and have those instructions mapped into the logical model.
  • 9. Creating EDM: • From the beginning of EF, you could generate the EDM from an existing Database. • Starting from Visual Studio 2010 and .Net Framework 4.0, there was a significant improvement regarding the creation of EDM. Now we have three ways for creating an EDM: 1) Database First: this is the traditional way by creating the EDM from Existing Database. 2) Model First: Allows you to start with an empty model, define your model and then generate the database, mappings, and classes from the defined model. 3) Code Only: Allows you to use the Entity Framework using Plain Old CLR Objects (POCO) entities and without an EDMX file