SlideShare a Scribd company logo
Entity Framework 4.1 “Code First” & DbContext Omar Qadan twitter.com/omarq
What Is ORM
ORM’s in .NET World Some Open Source  SubSonic Nhibernate … Some Commercial And the majority waiting microsft
Microsoft Answer  LinqToSQL Entity Framework Persistence Ignorance  ??
EF Approaches Database First Model First Code First
Database First Existing Database / DBA Maximum control Full T4 Template support (Self Tracking etc.) Not great with large models (50+ tables) Source Control merging headaches (XML)
Model First Generate Database / Migrate Like to “Draw” model / Designer Fan Less database centric Full T4 Template support Source Control merging nightmare (XML)
Code First Code Oriented / Dumb down DB No automated migration support (vNext) No T4 Template support / Self Tracking (yet) Source Control Branch friendly Cross EDMX easy No SP’s, Compiled Queries
Should have been V1 Simplifies Discoverability Does not replace  Needed backward compatibility Wraps ObjectContext ObjectContext accessible DbContext DbSet ObjectContext ObjectSet Entity Client Conceptual / Mapping / Logical DbContext & DbSet Recommended for all approaches Use ObjectContext only when needed.
Features Fluent API COC DBContext API
Demo
Wrapup / Questions
Resources You can find Slides for EF4.1 Code First and DB Context here http://www.slideshare.net/omarq/entity-framework41codefirst  and the code is here http://msdn.microsoft.com/en-us/data/gg685467 Entity Framework Videos http://msdn.microsoft.com/en-us/data/cc300162 Nuget.org the NuGet Package Manager  Elmahhttp://code.google.com/p/elmah/ Glimpse http://getglimpse.com/ Nerddinner reloaded http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx Microsoft Web Platform Installer  http://www.microsoft.com/web/downloads/platform.aspx

More Related Content

Viewers also liked

Copia de las adicciones
Copia de las adiccionesCopia de las adicciones
Copia de las adicciones
luisarturo02
 
00 historia-video
00 historia-video00 historia-video
Las adicciones
Las adiccionesLas adicciones
Las adicciones
luisarturo02
 
Las adicciones
Las adiccionesLas adicciones
Las adicciones
luisarturo02
 
Genghis khan
Genghis khanGenghis khan
Genghis khan
branmhin
 
Embedding flash video
Embedding flash videoEmbedding flash video
Embedding flash video
Francisco Javier Arce Anguiano
 
Working with sound and video
Working with sound and videoWorking with sound and video
Working with sound and video
Francisco Javier Arce Anguiano
 
Genghis khan
Genghis khanGenghis khan
Genghis khan
branmhin
 
La propiedad prototype en la programación orientada a objetos con JavaScript
La propiedad prototype en la programación orientada a objetos con JavaScriptLa propiedad prototype en la programación orientada a objetos con JavaScript
La propiedad prototype en la programación orientada a objetos con JavaScript
Francisco Javier Arce Anguiano
 
Concept mapping (prezentare diseminare Comenius)
Concept mapping (prezentare diseminare Comenius)Concept mapping (prezentare diseminare Comenius)
Concept mapping (prezentare diseminare Comenius)
Petruta Lostun
 
Apuntes: Crear examenes en Moodle
Apuntes: Crear examenes en MoodleApuntes: Crear examenes en Moodle
Apuntes: Crear examenes en Moodle
Francisco Javier Arce Anguiano
 

Viewers also liked (11)

Copia de las adicciones
Copia de las adiccionesCopia de las adicciones
Copia de las adicciones
 
00 historia-video
00 historia-video00 historia-video
00 historia-video
 
Las adicciones
Las adiccionesLas adicciones
Las adicciones
 
Las adicciones
Las adiccionesLas adicciones
Las adicciones
 
Genghis khan
Genghis khanGenghis khan
Genghis khan
 
Embedding flash video
Embedding flash videoEmbedding flash video
Embedding flash video
 
Working with sound and video
Working with sound and videoWorking with sound and video
Working with sound and video
 
Genghis khan
Genghis khanGenghis khan
Genghis khan
 
La propiedad prototype en la programación orientada a objetos con JavaScript
La propiedad prototype en la programación orientada a objetos con JavaScriptLa propiedad prototype en la programación orientada a objetos con JavaScript
La propiedad prototype en la programación orientada a objetos con JavaScript
 
Concept mapping (prezentare diseminare Comenius)
Concept mapping (prezentare diseminare Comenius)Concept mapping (prezentare diseminare Comenius)
Concept mapping (prezentare diseminare Comenius)
 
Apuntes: Crear examenes en Moodle
Apuntes: Crear examenes en MoodleApuntes: Crear examenes en Moodle
Apuntes: Crear examenes en Moodle
 

Similar to Entity framework-4.1-code-first

Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented development
rajmundr
 
Programming
Programming Programming
Programming
Kapcom Rawal
 
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
 
refORM: Death to ORMs in .NET
refORM: Death to ORMs in .NETrefORM: Death to ORMs in .NET
refORM: Death to ORMs in .NET
James Hughes
 
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 V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
ukdpe
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
ukdpe
 
Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0
Bishoy Demian
 
Kohana 3.1
Kohana 3.1Kohana 3.1
Kohana 3.1
Kemal Delalić
 
PHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codePHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the code
Michal Juhas
 
Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010
Eric Nelson
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
Jeff Fox
 
Web browser
Web browserWeb browser
Web browser
Abhijeet Shah
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
Amir Barylko
 
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnelEntity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
ukdpe
 
Flickr Services
Flickr ServicesFlickr Services
Flickr Services
royans
 
Flickr Services
Flickr ServicesFlickr Services
Flickr Services
royans
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
Stefano Paluello
 
Everyone loves PHP
Everyone loves PHPEveryone loves PHP
Everyone loves PHP
Abhijit Das
 
Disrupt
DisruptDisrupt
Disrupt
guest6b7220
 

Similar to Entity framework-4.1-code-first (20)

Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented development
 
Programming
Programming Programming
Programming
 
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)
 
refORM: Death to ORMs in .NET
refORM: Death to ORMs in .NETrefORM: Death to ORMs in .NET
refORM: Death to ORMs in .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 V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0
 
Kohana 3.1
Kohana 3.1Kohana 3.1
Kohana 3.1
 
PHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codePHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the code
 
Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
 
Web browser
Web browserWeb browser
Web browser
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnelEntity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
 
Flickr Services
Flickr ServicesFlickr Services
Flickr Services
 
Flickr Services
Flickr ServicesFlickr Services
Flickr Services
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Everyone loves PHP
Everyone loves PHPEveryone loves PHP
Everyone loves PHP
 
Disrupt
DisruptDisrupt
Disrupt
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 

Entity framework-4.1-code-first

  • 1. Entity Framework 4.1 “Code First” & DbContext Omar Qadan twitter.com/omarq
  • 3. ORM’s in .NET World Some Open Source SubSonic Nhibernate … Some Commercial And the majority waiting microsft
  • 4. Microsoft Answer LinqToSQL Entity Framework Persistence Ignorance ??
  • 5. EF Approaches Database First Model First Code First
  • 6. Database First Existing Database / DBA Maximum control Full T4 Template support (Self Tracking etc.) Not great with large models (50+ tables) Source Control merging headaches (XML)
  • 7. Model First Generate Database / Migrate Like to “Draw” model / Designer Fan Less database centric Full T4 Template support Source Control merging nightmare (XML)
  • 8. Code First Code Oriented / Dumb down DB No automated migration support (vNext) No T4 Template support / Self Tracking (yet) Source Control Branch friendly Cross EDMX easy No SP’s, Compiled Queries
  • 9. Should have been V1 Simplifies Discoverability Does not replace Needed backward compatibility Wraps ObjectContext ObjectContext accessible DbContext DbSet ObjectContext ObjectSet Entity Client Conceptual / Mapping / Logical DbContext & DbSet Recommended for all approaches Use ObjectContext only when needed.
  • 10. Features Fluent API COC DBContext API
  • 11. Demo
  • 13. Resources You can find Slides for EF4.1 Code First and DB Context here http://www.slideshare.net/omarq/entity-framework41codefirst and the code is here http://msdn.microsoft.com/en-us/data/gg685467 Entity Framework Videos http://msdn.microsoft.com/en-us/data/cc300162 Nuget.org the NuGet Package Manager Elmahhttp://code.google.com/p/elmah/ Glimpse http://getglimpse.com/ Nerddinner reloaded http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx Microsoft Web Platform Installer http://www.microsoft.com/web/downloads/platform.aspx