Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Entity Framework Today (May 2012)

Overview of Entity Framework (4.3) with advanced architecture information at the end. Presented at dotnet-zentral.ch in May 2012 by Julie Lerman

  • Login to see the comments

Entity Framework Today (May 2012)

  1. 1. Entity Framework Today Julie Lerman The Data Farm jlerman@thedatafarm.com twitter @julielerman Presented at Dotnet-zentral.ch May 2, 2012
  2. 2. Julie Lermanconsultant/mentorMicrosoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader,Pluralsight video authorcontactjlerman@theDataFarm.comwww.thedatafarm.comblogtheDataFarm.com/blogtwitter@julielermanbook web siteLearnEntityFramework.com
  3. 3. Plan A• Entity Framework Overview• “Getting Started” Code• Focus on some features• Non-”DemoWare” Solution
  4. 4. Object Relational MapperLINQ to EntitiesEntity SQL
  5. 5. Entity Data Model RuntimeEDMX EDM(XML) System.Data.Metadata.Edm .EntityType .EdmProperty .AssociationType .EdmType .FacetCode + Code First
  6. 6. EF4.x EntityFramework.dllCode First DbContextModel-less EF Simpler Access POCOPOCOPOCOPOCO Find, Local, Validation, etc…Entity Framework 4 Visual Studio 2010 EDM Designer “Core” (in .NET 4) (Object Services API (ObjectContext) & EntityClient API)
  7. 7. EF 5.x EntityFramework.dllCode First DbContextModel-less EF Simpler Access POCOPOCOPOCOPOCO Find, Local, Validation, etc… Entity Framework Visual Studio 11 Core EDM Designer (in .NET 4.5) (Object Services API (ObjectContext) & EntityClient API) New: Enum support, Geo Data, auto query cache etc.
  8. 8. EntityFramework.dll
  9. 9. Getting Started Pick your modeling workflow DB First, Model First, Code First Use DbContext for new projects ObjectContext accessible if you need it Database? Existing or let Code First/Model First create it Database or Model Changes Model Updates & DB Updates (“migrations”) supported Consider architecture*Separate projects for model, context, etc *Repositories, UOW, automated tests, etc.
  10. 10. Shall we code?
  11. 11. Feature DemosMore on migrationsNo-tracking queries (performance)Managing disconnected stateData layer validationsMy favorite small DbContext featuresT4Scaffolding to gen context & repo
  12. 12. ARCHITECTURE
  13. 13. UI Service Layer Bus Layer Repo/UoW LINQData Layer EFDatabase
  14. 14. Testable Classes System.Data.Entity FakeObject/DbSet Fake Metadata & Fake Context & DataA Object/DbContext Context & Data B Class Class Class Repositories Class RepositoriesTests Repositories Repositories Unit of Work UI
  15. 15. Some “controversies”EF &Repository/Unit of WorkAbstracting ORMs
  16. 16. Resources• MSDN Developer Center: msdn.com/data/ef• EF Team: blogs.msdn.com/adonet• Rowan Miller Blog: romiller.com• Arthur Vickers: blog.oneunicorn.com• Julie Lerman: thedatafarm.com/blog• LearnEntityFramework.com• Pluralsight.com videos• MSDN Magazine Data Points Column – http://JulieL.me/datapointscolumn
  17. 17. Julie Lermanconsultant/mentorMicrosoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leadercontactjlerman@theDataFarm.comwww.thedatafarm.comblogtheDataFarm.com/blogtwitter@julielermanbook web siteLearnEntityFramework.com
  18. 18. Resources• MSDN Developer Center: msdn.com/data/ef• EF Team: blogs.msdn.com/adonet• Rowan Miller Blog: romiller.com• Arthur Vickers: blog.oneunicorn.com• Julie Lerman: thedatafarm.com/blog• LearnEntityFramework.com• Pluralsight.com videos• MSDN Magazine Data Points Column – http://JulieL.me/datapointscolumn
  19. 19. Julie Lermanconsultant/mentorMicrosoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leadercontactjlerman@theDataFarm.comwww.thedatafarm.comblogtheDataFarm.com/blogtwitter@julielermanbook web siteLearnEntityFramework.com

×