SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Lushanthan S.



getting started with Microsoft

Entity Framework
Today’s Agenda
 Introduction

 The Architecture

 Entity Data Model

 The Conceptual Model – .edmx file, exploring the classes

 Demo
    LINQ to Entities
    Lazy Loading
    CRUD
    Stored Procedures

 Shipped Products
Our life so far…
               All of us have worked on Data access!
               Objects != Relational Data – “Impedance mismatch”
Introduction




               Languages     C#                        SQL

               Tools         Visual Studio             SQL Server

               Paradigms     Object                    Procedural

               Common API     ADO.NET


               Powerful, but fragile and time consuming!
Legacy ADO.NET
               Sample Code:
                    using (SqlConnection conn = new SqlConnection("<conn string>"))
                               {
                                   conn.Open();
                                   SqlCommand cmd = conn.CreateCommand();
                                   cmd.CommandText = "sp_StoredProc";
                                   cmd.parameters.AddWithValue("@City", "Colombo");

                                   using (SqlDataReader rdr = cmd.ExecuteReader())
                                   {
                                       while (rdr.read())
                                       {
Introduction




                                           string name = rdr.GetString(0);
                                           string city = rdr.GetString(1);
                                       }
                                   }
                              }




               Loosely typed!
microsoft giving this to us as a
What about

Product?
                 Yes, there comes Microsoft Entity Framework
History of Data Access in .Net

               ADO.Net Inline SQL
               Data Sets
               Stored Procedures
               ORM - Typed Data Sets, LINQ to SQL, EF1, EF4
Introduction




               Bridging the gap between objects and relational data!
What is Entity Framework?
               Released in July 2008, EF is a data access framework from
               Microsoft that helps to bridge the gap between data structures
               and objects in your applications.

               What does it really do?
               It automatically,
Introduction




                    generates strongly-typed entity objects that can be
                   customized beyond 1-1 mapping
                   generates mapping/plumbing code
                   translates LINQ queries to database queries
                   materializes objects from data store calls
                   tracks changes, generating updates/inserts
The Architecture   Under the hood
Bird’s Eye View

                         Entity Framework

                         LINQ to Entities, Entity SQL, Query
                         builder methods
                                                                   Programming
                         ADO.NET Entity Provider (entity client)   Model
The Architecture




                         Conceptual Data Model




                          Legacy ADO.NET does not go away!

                     ADO.NET Data Provider
                     (SqlClient, OracleClient)

                          Reader                 Connection
                                                                                 Store
                          Adapter                Command
Entity Data Model
                     Set of objects that describe structure of your business
                     data and map to your underlying data store.

                       Contained in Three XML sections stored in *.edmx file:
Entity Data Model




                        Database                                         Entity
                        Schema                                           Objects

                         Storage Model             Mapping               Conceptual Model


                    Database                                        UI          OO     Services
The Conceptual Model   The Conceptual Model
 Exploring the conceptual
                                       model

                                      Database First

                                      Model First

                                      LINQ to Entities

                                      CRUD

                                      Lazy Loading
Demo                                  Include()

Following sections will be covered    Stored Procedures
                                     .

.
Shipped Products
                    Entity Framework 1.0 (.NET 3.5 SP1/ VS 2008 SP1 )

                    Entity Framework 4.0 (.NET 4/ VS 2010 )
                      • Model-First support
                      • Foreign Keys in the conceptual Model
Shipped Products




                      • Lazy loading
                      • Persistence-Ignorant Objects (POCO) support
                      • Self-Tracking Entities

                    Entity Framework 4.1, 4.2, 4.3 (.NET 4/ VS 2010 )
                      • Code-first Migration

                    Entity Framework 5.0 beta1, 2 (.NET 4.5 Beta/ VS 2011 Beta )
                      • Enum support
                      • Tabled valued functions support
Linq to SQL Vs Entity Framework

L2S
      Strongly typed LINQ access for RAD against SQL Server only
      Support s only direct Table-Per-Type (1-to-1) mapping
      Limited out-of-the box support for complex scenarios
EF
      Designed for larger enterprise applications
      Enables complex mapping complex scenarios
      Tools and designer more robust
      Supports inheritance and many-to-many relationships
      Supports provider independence


                                14
?
    But wait…
    There’s More!
Areas not covered

 POCO Entities

 Entity SQL

 T4 Templates

 Code first Approach




                        16
The End

Microsoft

Entity Framework
Q & A Session

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET CoreAvanade Nederland
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewShahed Chowdhuri
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Aijaz Ali Abro
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCKhaled Musaied
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaEdureka!
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Edureka!
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 

Was ist angesagt? (20)

Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Web api
Web apiWeb api
Web api
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
What is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | EdurekaWhat is REST API? REST API Concepts and Examples | Edureka
What is REST API? REST API Concepts and Examples | Edureka
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 

Andere mochten auch

Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Bishoy Demian
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use itnspyre_net
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And TricksJulie Lerman
 
Lerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In AspnetLerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In AspnetJulie Lerman
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code FirstJames Johnson
 
Using sql server in c sharp
Using sql server in c sharpUsing sql server in c sharp
Using sql server in c sharpFaruk Alkan
 
Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5Ehtsham Khan
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Enea Gabriel
 
Dotnet differences compiled -1
Dotnet differences compiled -1Dotnet differences compiled -1
Dotnet differences compiled -1Umar Ali
 
05 entity framework
05 entity framework05 entity framework
05 entity frameworkglubox
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignJulie Lerman
 
Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Eyal Vardi
 
Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.netNgeam Soly
 
Case Study # Odoo Implementation @ Samuda Chemical Complex Ltd
Case Study # Odoo Implementation @ Samuda Chemical Complex LtdCase Study # Odoo Implementation @ Samuda Chemical Complex Ltd
Case Study # Odoo Implementation @ Samuda Chemical Complex LtdMatiar Rahman
 

Andere mochten auch (20)

Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And Tricks
 
Lerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In AspnetLerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In Aspnet
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
 
Using sql server in c sharp
Using sql server in c sharpUsing sql server in c sharp
Using sql server in c sharp
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5Getting started with entity framework 6 code first using mvc 5
Getting started with entity framework 6 code first using mvc 5
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
 
Ado .net
Ado .netAdo .net
Ado .net
 
Dotnet differences compiled -1
Dotnet differences compiled -1Dotnet differences compiled -1
Dotnet differences compiled -1
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
 
Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)
 
Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Case Study # Odoo Implementation @ Samuda Chemical Complex Ltd
Case Study # Odoo Implementation @ Samuda Chemical Complex LtdCase Study # Odoo Implementation @ Samuda Chemical Complex Ltd
Case Study # Odoo Implementation @ Samuda Chemical Complex Ltd
 

Ähnlich wie Getting started with entity framework

Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2Eric Nelson
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2ukdpe
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource GroupShahzad
 
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)David McCarter
 
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)David McCarter
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework OverviewEric Nelson
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overviewukdpe
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09manisoft84
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?ukdpe
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstEnea Gabriel
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity FrameworkMahmoud Tolba
 
Microsoft Data Access Technologies
Microsoft Data Access TechnologiesMicrosoft Data Access Technologies
Microsoft Data Access TechnologiesDavid Chou
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework OverviewEyal Vardi
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Julie Lerman
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0Abhishek Sur
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best PracticesAndri Yadi
 
ADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDaysADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDaysukdpe
 
Entity framework introduction sesion-1
Entity framework introduction   sesion-1Entity framework introduction   sesion-1
Entity framework introduction sesion-1Usama Nada
 

Ähnlich wie Getting started with entity framework (20)

Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
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)
 
5c8605.ado.net
5c8605.ado.net5c8605.ado.net
5c8605.ado.net
 
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)
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
 
Microsoft Data Access Technologies
Microsoft Data Access TechnologiesMicrosoft Data Access Technologies
Microsoft Data Access Technologies
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
 
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 DevDays
ADO.NET Entity Framework DevDaysADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDays
 
Entity framework introduction sesion-1
Entity framework introduction   sesion-1Entity framework introduction   sesion-1
Entity framework introduction sesion-1
 

Kürzlich hochgeladen

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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.pdfUK Journal
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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.pdfsudhanshuwaghmare1
 
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 Takeoffsammart93
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...apidays
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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 2024Rafal Los
 

Kürzlich hochgeladen (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 

Getting started with entity framework

  • 1. Lushanthan S. getting started with Microsoft Entity Framework
  • 2. Today’s Agenda  Introduction  The Architecture  Entity Data Model  The Conceptual Model – .edmx file, exploring the classes  Demo  LINQ to Entities  Lazy Loading  CRUD  Stored Procedures  Shipped Products
  • 3. Our life so far… All of us have worked on Data access! Objects != Relational Data – “Impedance mismatch” Introduction Languages C# SQL Tools Visual Studio SQL Server Paradigms Object Procedural Common API ADO.NET Powerful, but fragile and time consuming!
  • 4. Legacy ADO.NET Sample Code: using (SqlConnection conn = new SqlConnection("<conn string>")) { conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "sp_StoredProc"; cmd.parameters.AddWithValue("@City", "Colombo"); using (SqlDataReader rdr = cmd.ExecuteReader()) { while (rdr.read()) { Introduction string name = rdr.GetString(0); string city = rdr.GetString(1); } } } Loosely typed!
  • 5. microsoft giving this to us as a What about Product? Yes, there comes Microsoft Entity Framework
  • 6. History of Data Access in .Net ADO.Net Inline SQL Data Sets Stored Procedures ORM - Typed Data Sets, LINQ to SQL, EF1, EF4 Introduction Bridging the gap between objects and relational data!
  • 7. What is Entity Framework? Released in July 2008, EF is a data access framework from Microsoft that helps to bridge the gap between data structures and objects in your applications. What does it really do? It automatically, Introduction  generates strongly-typed entity objects that can be customized beyond 1-1 mapping  generates mapping/plumbing code  translates LINQ queries to database queries  materializes objects from data store calls  tracks changes, generating updates/inserts
  • 8. The Architecture Under the hood
  • 9. Bird’s Eye View Entity Framework LINQ to Entities, Entity SQL, Query builder methods Programming ADO.NET Entity Provider (entity client) Model The Architecture Conceptual Data Model Legacy ADO.NET does not go away! ADO.NET Data Provider (SqlClient, OracleClient) Reader Connection Store Adapter Command
  • 10. Entity Data Model Set of objects that describe structure of your business data and map to your underlying data store. Contained in Three XML sections stored in *.edmx file: Entity Data Model Database Entity Schema Objects Storage Model Mapping Conceptual Model Database UI OO Services
  • 11. The Conceptual Model The Conceptual Model
  • 12.  Exploring the conceptual model  Database First  Model First  LINQ to Entities  CRUD  Lazy Loading Demo  Include() Following sections will be covered  Stored Procedures . .
  • 13. Shipped Products  Entity Framework 1.0 (.NET 3.5 SP1/ VS 2008 SP1 )  Entity Framework 4.0 (.NET 4/ VS 2010 ) • Model-First support • Foreign Keys in the conceptual Model Shipped Products • Lazy loading • Persistence-Ignorant Objects (POCO) support • Self-Tracking Entities  Entity Framework 4.1, 4.2, 4.3 (.NET 4/ VS 2010 ) • Code-first Migration  Entity Framework 5.0 beta1, 2 (.NET 4.5 Beta/ VS 2011 Beta ) • Enum support • Tabled valued functions support
  • 14. Linq to SQL Vs Entity Framework L2S Strongly typed LINQ access for RAD against SQL Server only Support s only direct Table-Per-Type (1-to-1) mapping Limited out-of-the box support for complex scenarios EF Designed for larger enterprise applications Enables complex mapping complex scenarios Tools and designer more robust Supports inheritance and many-to-many relationships Supports provider independence 14
  • 15. ? But wait… There’s More!
  • 16. Areas not covered  POCO Entities  Entity SQL  T4 Templates  Code first Approach 16

Hinweis der Redaktion

  1. The Entity Framework includes the EntityClient data provider. This provider manages connections, translates entity queries into data source-specific queries, and returns a data reader that the Entity Framework uses to materialize entity data into objects.
  2. 5.0 beta http://msdn.microsoft.com/en-us/library/hh551137%28VS.103%29.aspx
  3. http://daveswersky.com/2010/05/26/entity-framework-4-then-and-now/