SlideShare uma empresa Scribd logo
1 de 13
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

Mais conteúdo relacionado

Destaque (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
 

Semelhante a Entity framework-4.1-code-first

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
 
Erlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web WisdomErlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web Wisdom
guest3933de
 

Semelhante a 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
 
Erlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web WisdomErlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web Wisdom
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

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