SlideShare a Scribd company logo
1 of 9
Download to read offline
Entity Framework
(EF)
Eng. Mahmoud Ouf
Lecture 1
mmouf@2017
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.
mmouf@2017
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.
mmouf@2017
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.
mmouf@2017
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.
mmouf@2017
The Entity Framework Architecture
Application
Entity Framework
Entity Data Model (EDM)
Describe Object Relational Mapping
ADO .NET Provider
Data Store
ORM Interface
mmouf@2017
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.
mmouf@2017
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.
mmouf@2017
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
mmouf@2017

More Related Content

What's hot

What's hot (20)

Understanding linq
Understanding linqUnderstanding linq
Understanding linq
 
LINQ
LINQLINQ
LINQ
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
GSP 125 Final Exam Guide
GSP 125 Final Exam GuideGSP 125 Final Exam Guide
GSP 125 Final Exam Guide
 
Linq
LinqLinq
Linq
 
Linq
LinqLinq
Linq
 
GSP 125 Final Exam Guide
GSP 125 Final Exam GuideGSP 125 Final Exam Guide
GSP 125 Final Exam Guide
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
Gsp 125 final exam guide
Gsp 125 final exam guideGsp 125 final exam guide
Gsp 125 final exam guide
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
C Programming: Structure and Union
C Programming: Structure and UnionC Programming: Structure and Union
C Programming: Structure and Union
 
Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)
 
Introduction Of Linq , ASP.NET Training Ahmedabad, ASP.NET Course Ahmedabad
Introduction Of Linq , ASP.NET Training Ahmedabad, ASP.NET Course AhmedabadIntroduction Of Linq , ASP.NET Training Ahmedabad, ASP.NET Course Ahmedabad
Introduction Of Linq , ASP.NET Training Ahmedabad, ASP.NET Course Ahmedabad
 
Language Integrated Query - LINQ
Language Integrated Query - LINQLanguage Integrated Query - LINQ
Language Integrated Query - LINQ
 
.NET presentation
.NET presentation.NET presentation
.NET presentation
 
Class and object
Class and objectClass and object
Class and object
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
 
Dynamic Memory Allocation, Pointers and Functions, Pointers and Structures
Dynamic Memory Allocation, Pointers and Functions, Pointers and StructuresDynamic Memory Allocation, Pointers and Functions, Pointers and Structures
Dynamic Memory Allocation, Pointers and Functions, Pointers and Structures
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
 

Viewers also liked

Scikit-Learn para MLLib: Machine Learning em Larga Escala
Scikit-Learn para MLLib: Machine Learning em Larga EscalaScikit-Learn para MLLib: Machine Learning em Larga Escala
Scikit-Learn para MLLib: Machine Learning em Larga EscalaGuilherme Peixoto
 
COMO PINTO ACRILICO
COMO PINTO ACRILICOCOMO PINTO ACRILICO
COMO PINTO ACRILICOveris1963
 
Gruppo di famiglia in un interno facebook
Gruppo di famiglia in un interno facebookGruppo di famiglia in un interno facebook
Gruppo di famiglia in un interno facebookyuliy davidov
 
Analysis of the use of sound in previous
Analysis of the use of sound in previousAnalysis of the use of sound in previous
Analysis of the use of sound in previousEzgi Cicek
 
From the Big Bang to Ecommerce, a journey in making sense of Big Data
From the Big Bang to Ecommerce, a journey in making sense of Big DataFrom the Big Bang to Ecommerce, a journey in making sense of Big Data
From the Big Bang to Ecommerce, a journey in making sense of Big DataPatrick Deglon
 
Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)Sam Livingston-Gray
 
DEFINICIÓN SOBRE EL AMOR
DEFINICIÓN SOBRE EL AMORDEFINICIÓN SOBRE EL AMOR
DEFINICIÓN SOBRE EL AMORAlquimista Aula
 
1. prepare usb installer
1.  prepare usb installer1.  prepare usb installer
1. prepare usb installerkris harden
 
Training & workshop lesson plan medea ocotber 21st 2014
Training & workshop lesson plan  medea ocotber 21st 2014 Training & workshop lesson plan  medea ocotber 21st 2014
Training & workshop lesson plan medea ocotber 21st 2014 Mr Bounab Samir
 
Bahasa Mandarin Dasar
Bahasa Mandarin DasarBahasa Mandarin Dasar
Bahasa Mandarin DasarDevy Riani
 

Viewers also liked (17)

Tratado de Neuilly
Tratado de NeuillyTratado de Neuilly
Tratado de Neuilly
 
HRM Management Institute
HRM Management InstituteHRM Management Institute
HRM Management Institute
 
Scikit-Learn para MLLib: Machine Learning em Larga Escala
Scikit-Learn para MLLib: Machine Learning em Larga EscalaScikit-Learn para MLLib: Machine Learning em Larga Escala
Scikit-Learn para MLLib: Machine Learning em Larga Escala
 
COMO PINTO ACRILICO
COMO PINTO ACRILICOCOMO PINTO ACRILICO
COMO PINTO ACRILICO
 
Gruppo di famiglia in un interno facebook
Gruppo di famiglia in un interno facebookGruppo di famiglia in un interno facebook
Gruppo di famiglia in un interno facebook
 
JOMC slide deck
JOMC slide deckJOMC slide deck
JOMC slide deck
 
Analysis of the use of sound in previous
Analysis of the use of sound in previousAnalysis of the use of sound in previous
Analysis of the use of sound in previous
 
Information Mapping (1)
Information Mapping (1)Information Mapping (1)
Information Mapping (1)
 
From the Big Bang to Ecommerce, a journey in making sense of Big Data
From the Big Bang to Ecommerce, a journey in making sense of Big DataFrom the Big Bang to Ecommerce, a journey in making sense of Big Data
From the Big Bang to Ecommerce, a journey in making sense of Big Data
 
Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)Fluent Refactoring (Cascadia Ruby Conf 2013)
Fluent Refactoring (Cascadia Ruby Conf 2013)
 
DEFINICIÓN SOBRE EL AMOR
DEFINICIÓN SOBRE EL AMORDEFINICIÓN SOBRE EL AMOR
DEFINICIÓN SOBRE EL AMOR
 
Dilasa
DilasaDilasa
Dilasa
 
Affiches de la famille
Affiches de la familleAffiches de la famille
Affiches de la famille
 
1. prepare usb installer
1.  prepare usb installer1.  prepare usb installer
1. prepare usb installer
 
Training & workshop lesson plan medea ocotber 21st 2014
Training & workshop lesson plan  medea ocotber 21st 2014 Training & workshop lesson plan  medea ocotber 21st 2014
Training & workshop lesson plan medea ocotber 21st 2014
 
Bmw museum
Bmw museumBmw museum
Bmw museum
 
Bahasa Mandarin Dasar
Bahasa Mandarin DasarBahasa Mandarin Dasar
Bahasa Mandarin Dasar
 

Similar to Intake 37 ef1

Intake 38 data access 4
Intake 38 data access 4Intake 38 data access 4
Intake 38 data access 4Mahmoud Ouf
 
Improved Presentation and Facade Layer Operations for Software Engineering Pr...
Improved Presentation and Facade Layer Operations for Software Engineering Pr...Improved Presentation and Facade Layer Operations for Software Engineering Pr...
Improved Presentation and Facade Layer Operations for Software Engineering Pr...Dr. Amarjeet Singh
 
A Comparative Study of RDBMs and OODBMs in Relation to Security of Data
A Comparative Study of RDBMs and OODBMs in Relation to Security of DataA Comparative Study of RDBMs and OODBMs in Relation to Security of Data
A Comparative Study of RDBMs and OODBMs in Relation to Security of Datainscit2006
 
Document Based Data Modeling Technique
Document Based Data Modeling TechniqueDocument Based Data Modeling Technique
Document Based Data Modeling TechniqueCarmen Sanborn
 
Comparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented DatabaseComparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented DatabaseEditor IJMTER
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system reportAmit Kulkarni
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system reportAmit Kulkarni
 
In Memory Database Essay
In Memory Database EssayIn Memory Database Essay
In Memory Database EssayTammy Moncrief
 
Discussion post· The proper implementation of a database is es.docx
Discussion post· The proper implementation of a database is es.docxDiscussion post· The proper implementation of a database is es.docx
Discussion post· The proper implementation of a database is es.docxmadlynplamondon
 
data base system to new data science lerne
data base system to new data science lernedata base system to new data science lerne
data base system to new data science lernetarunprajapati0t
 
Database Management System, Lecture-1
Database Management System, Lecture-1Database Management System, Lecture-1
Database Management System, Lecture-1Sonia Mim
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxsqlserver4
 

Similar to Intake 37 ef1 (20)

Intake 38 data access 4
Intake 38 data access 4Intake 38 data access 4
Intake 38 data access 4
 
Entity Framework
Entity FrameworkEntity Framework
Entity Framework
 
Improved Presentation and Facade Layer Operations for Software Engineering Pr...
Improved Presentation and Facade Layer Operations for Software Engineering Pr...Improved Presentation and Facade Layer Operations for Software Engineering Pr...
Improved Presentation and Facade Layer Operations for Software Engineering Pr...
 
A Comparative Study of RDBMs and OODBMs in Relation to Security of Data
A Comparative Study of RDBMs and OODBMs in Relation to Security of DataA Comparative Study of RDBMs and OODBMs in Relation to Security of Data
A Comparative Study of RDBMs and OODBMs in Relation to Security of Data
 
Ef overview
Ef overviewEf overview
Ef overview
 
Document Based Data Modeling Technique
Document Based Data Modeling TechniqueDocument Based Data Modeling Technique
Document Based Data Modeling Technique
 
Comparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented DatabaseComparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented Database
 
DBMS-Unit-1.pptx
DBMS-Unit-1.pptxDBMS-Unit-1.pptx
DBMS-Unit-1.pptx
 
DDD
DDDDDD
DDD
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system report
 
Office automation system report
Office automation system reportOffice automation system report
Office automation system report
 
Cse ii ii sem
Cse ii ii semCse ii ii sem
Cse ii ii sem
 
In Memory Database Essay
In Memory Database EssayIn Memory Database Essay
In Memory Database Essay
 
Discussion post· The proper implementation of a database is es.docx
Discussion post· The proper implementation of a database is es.docxDiscussion post· The proper implementation of a database is es.docx
Discussion post· The proper implementation of a database is es.docx
 
data base system to new data science lerne
data base system to new data science lernedata base system to new data science lerne
data base system to new data science lerne
 
Database Management System, Lecture-1
Database Management System, Lecture-1Database Management System, Lecture-1
Database Management System, Lecture-1
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 
Database Systems Concepts, 5th Ed
Database Systems Concepts, 5th EdDatabase Systems Concepts, 5th Ed
Database Systems Concepts, 5th Ed
 
02010 ppt ch02
02010 ppt ch0202010 ppt ch02
02010 ppt ch02
 

More from Mahmoud Ouf

More from Mahmoud Ouf (20)

Relation between classes in arabic
Relation between classes in arabicRelation between classes in arabic
Relation between classes in arabic
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
 
Intake 38 12
Intake 38 12Intake 38 12
Intake 38 12
 
Intake 38 11
Intake 38 11Intake 38 11
Intake 38 11
 
Intake 38 10
Intake 38 10Intake 38 10
Intake 38 10
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
 
Intake 38 8
Intake 38 8Intake 38 8
Intake 38 8
 
Intake 38 7
Intake 38 7Intake 38 7
Intake 38 7
 
Intake 38 6
Intake 38 6Intake 38 6
Intake 38 6
 
Intake 38 5 1
Intake 38 5 1Intake 38 5 1
Intake 38 5 1
 
Intake 38 5
Intake 38 5Intake 38 5
Intake 38 5
 
Intake 38 3
Intake 38 3Intake 38 3
Intake 38 3
 
Intake 38 2
Intake 38 2Intake 38 2
Intake 38 2
 
Intake 37 DM
Intake 37 DMIntake 37 DM
Intake 37 DM
 
Intake 37 12
Intake 37 12Intake 37 12
Intake 37 12
 
Intake 37 11
Intake 37 11Intake 37 11
Intake 37 11
 
Intake 37 10
Intake 37 10Intake 37 10
Intake 37 10
 
Intake 37 9
Intake 37 9Intake 37 9
Intake 37 9
 
Intake 37 8
Intake 37 8Intake 37 8
Intake 37 8
 

Recently uploaded

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Intake 37 ef1

  • 1. Entity Framework (EF) Eng. Mahmoud Ouf Lecture 1 mmouf@2017
  • 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. mmouf@2017
  • 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. mmouf@2017
  • 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. mmouf@2017
  • 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. mmouf@2017
  • 6. The Entity Framework Architecture Application Entity Framework Entity Data Model (EDM) Describe Object Relational Mapping ADO .NET Provider Data Store ORM Interface mmouf@2017
  • 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. mmouf@2017
  • 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. mmouf@2017
  • 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 mmouf@2017