SlideShare a Scribd company logo
1 of 17
Entity Framework Eyal Vardi CEO E4D Solutions LTDMicrosoft MVP Visual C#blog: www.eVardi.com
Agenda Data Access History OO vs. Relational World EF Architecture Development Approaches EF 4.0+ New API EDM LINQ to Entities Entity SQL Conceptual Model Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
Data Access History
Services:- Change tracking- Concurrency control- Object identity SQL or Stored Procs Rows SQLServer Entity Framework Entity Framework Flow Application from c in db.Customerswhere c.City == "London"select new { c.Name, c.Phone } Objects LINQ Query SubmitChanges() EDMX ADO.NET Provider SQL Query select Name, Phonefrom customerswhere city = 'London'
OO vs. Relational World Data Types Associations Granularity Inheritance Identity
EF Architecture SQLServer EDM LINQ to Entities Entity SQL Conceptual Model Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
Entity Data Model (EDM) The EDM is the link between the model and the database. The EDM is that it decouples your application from the underlying store. Entity Data Model (EDM) StorageModel (SSDL) Mapping (MSL) Conceptual Model (CSDL) Storage
Object Services Materialization  The process of transforming the data obtained from the Entity Client data provider, which has a tabular structure, into objects.  Change tracking  Tracks any changes made to the objects. Query transformation Translates queries it into a command tree that’s then passed on to the underlying Entity Client. ,[object Object],[object Object]
Entity SQL & LINQ to Entities LINQ to Entities - The  LINQ dialect that enables typed  queries against the model. Entity SQL - The second way of querying the object model. Entity SQL is string-based. Can be used to retrieve data at low level, directly using the Entity Client.
EDM LINQ to Entities Entity SQL Conceptual Model Development Approaches Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
Database First DB If you already have a database, the Entity Framework can automatically generate a data model that consists of classes and properties that correspond to existing database objects such as tables and columns.  Generated Data Model (.edmx) Database First
Model First Generated DB If you don't yet have a database, you can begin by creating a model using the Entity Framework designer in Visual Studio.  The designer can generate DDL (data definition language) statements to create the database.  Data Model (.edmx) Model First
DB Generated Data Model (Classes) Code First Code First Generated DB Whether you have an existing database or not, you can code your own classes and properties that correspond to tables and columns and use them with the Entity Framework without an .edmx file. Data Model (Classes) Code First
Why DbContext & DbSet? This API provides a more productive surface for working with the EF and can be used with the Code First, Database First, and Model First approaches. Model Discovery Model Caching DbSet Initialization Database Provisioning DbModelConstructor ObjectContextConstructor * More info click here
EF 4.1 New API
Features That Are Not Supported features are not supported by the DbContextAPI. To use these features, use the ObjectContextAPI. Compiled queries MEST (Multiple Entity Sets per Type) Self-tracking entities.  To use the DbContext API in an N-tier application, consider using WCF Data Services or RIA Services.
Entity Framework Overview

More Related Content

What's hot

Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
Confiz
 

What's hot (20)

Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
 
Introducing the Entity Framework
Introducing the Entity FrameworkIntroducing the Entity Framework
Introducing the Entity Framework
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Building nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework ServicesBuilding nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework Services
 
LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Hibernate
HibernateHibernate
Hibernate
 
Hibernate
HibernateHibernate
Hibernate
 
Day5
Day5Day5
Day5
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Ado .net
Ado .netAdo .net
Ado .net
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 

Similar to Entity Framework Overview

What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
ukdpe
 
Ado.net entity framework_4.0
Ado.net entity framework_4.0Ado.net entity framework_4.0
Ado.net entity framework_4.0
Rishu Mehra
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
Igor Moochnick
 
ADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaADO .NET by Sonu Vishwakarma
ADO .NET by Sonu Vishwakarma
Sonu Vishwakarma
 

Similar to Entity Framework Overview (20)

ADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDaysADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDays
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 
Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010
 
Ado.net entity framework_4.0
Ado.net entity framework_4.0Ado.net entity framework_4.0
Ado.net entity framework_4.0
 
Entity framework1
Entity framework1Entity framework1
Entity framework1
 
Entity frameworks101
Entity frameworks101Entity frameworks101
Entity frameworks101
 
Microsoft Data Access Technologies
Microsoft Data Access TechnologiesMicrosoft Data Access Technologies
Microsoft Data Access Technologies
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 
ADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaADO .NET by Sonu Vishwakarma
ADO .NET by Sonu Vishwakarma
 
e-SUAP - Data access server side (English)
e-SUAP - Data access server side (English)e-SUAP - Data access server side (English)
e-SUAP - Data access server side (English)
 
How do i connect to that
How do i connect to thatHow do i connect to that
How do i connect to that
 
PPT temp.pptx
PPT temp.pptxPPT temp.pptx
PPT temp.pptx
 
Dot net online training
Dot net online training Dot net online training
Dot net online training
 
B_110500002
B_110500002B_110500002
B_110500002
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
.net online training
.net online training .net online training
.net online training
 
.NET ONLINE TRAINING COURSE CONTENT
.NET ONLINE TRAINING COURSE CONTENT .NET ONLINE TRAINING COURSE CONTENT
.NET ONLINE TRAINING COURSE CONTENT
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
 
.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13
 

More from Eyal Vardi

More from Eyal Vardi (20)

Why magic
Why magicWhy magic
Why magic
 
Smart Contract
Smart ContractSmart Contract
Smart Contract
 
Rachel's grandmother's recipes
Rachel's grandmother's recipesRachel's grandmother's recipes
Rachel's grandmother's recipes
 
Performance Optimization In Angular 2
Performance Optimization In Angular 2Performance Optimization In Angular 2
Performance Optimization In Angular 2
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModule
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
 
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time CompilationAngular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
 
Routing And Navigation
Routing And NavigationRouting And Navigation
Routing And Navigation
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 Architecture
 
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.xAngular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
 
Angular 2.0 Views
Angular 2.0 ViewsAngular 2.0 Views
Angular 2.0 Views
 
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0
 
Http Communication in Angular 2.0
Http Communication in Angular 2.0Http Communication in Angular 2.0
Http Communication in Angular 2.0
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injection
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
 
Async & Parallel in JavaScript
Async & Parallel in JavaScriptAsync & Parallel in JavaScript
Async & Parallel in JavaScript
 
Angular 2.0 Pipes
Angular 2.0 PipesAngular 2.0 Pipes
Angular 2.0 Pipes
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 forms
 

Recently uploaded

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Entity Framework Overview

  • 1. Entity Framework Eyal Vardi CEO E4D Solutions LTDMicrosoft MVP Visual C#blog: www.eVardi.com
  • 2. Agenda Data Access History OO vs. Relational World EF Architecture Development Approaches EF 4.0+ New API EDM LINQ to Entities Entity SQL Conceptual Model Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
  • 4. Services:- Change tracking- Concurrency control- Object identity SQL or Stored Procs Rows SQLServer Entity Framework Entity Framework Flow Application from c in db.Customerswhere c.City == "London"select new { c.Name, c.Phone } Objects LINQ Query SubmitChanges() EDMX ADO.NET Provider SQL Query select Name, Phonefrom customerswhere city = 'London'
  • 5. OO vs. Relational World Data Types Associations Granularity Inheritance Identity
  • 6. EF Architecture SQLServer EDM LINQ to Entities Entity SQL Conceptual Model Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
  • 7. Entity Data Model (EDM) The EDM is the link between the model and the database. The EDM is that it decouples your application from the underlying store. Entity Data Model (EDM) StorageModel (SSDL) Mapping (MSL) Conceptual Model (CSDL) Storage
  • 8.
  • 9. Entity SQL & LINQ to Entities LINQ to Entities - The LINQ dialect that enables typed queries against the model. Entity SQL - The second way of querying the object model. Entity SQL is string-based. Can be used to retrieve data at low level, directly using the Entity Client.
  • 10. EDM LINQ to Entities Entity SQL Conceptual Model Development Approaches Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
  • 11. Database First DB If you already have a database, the Entity Framework can automatically generate a data model that consists of classes and properties that correspond to existing database objects such as tables and columns. Generated Data Model (.edmx) Database First
  • 12. Model First Generated DB If you don't yet have a database, you can begin by creating a model using the Entity Framework designer in Visual Studio. The designer can generate DDL (data definition language) statements to create the database. Data Model (.edmx) Model First
  • 13. DB Generated Data Model (Classes) Code First Code First Generated DB Whether you have an existing database or not, you can code your own classes and properties that correspond to tables and columns and use them with the Entity Framework without an .edmx file. Data Model (Classes) Code First
  • 14. Why DbContext & DbSet? This API provides a more productive surface for working with the EF and can be used with the Code First, Database First, and Model First approaches. Model Discovery Model Caching DbSet Initialization Database Provisioning DbModelConstructor ObjectContextConstructor * More info click here
  • 15. EF 4.1 New API
  • 16. Features That Are Not Supported features are not supported by the DbContextAPI. To use these features, use the ObjectContextAPI. Compiled queries MEST (Multiple Entity Sets per Type) Self-tracking entities. To use the DbContext API in an N-tier application, consider using WCF Data Services or RIA Services.