Deep Dive into
Entity Framework 6
Diego Vega
Developer Lead
Microsoft
Deep Dive into EF6 | Agenda



          Runtime
  Open       &                Release
                      Demo              Post EF6
 Source   Designer            details
          features
EF Overview | What is EF?


 • Recommended technology to connect .NET            Microsoft’s
   applications to databases                         Object/Relational
 • LINQ against disparate relational databases       Mapper

 • Make .NET & Windows Azure the best platform for
   data centered apps                                Product goals
 • Be the most productive data access API
EF6 | Open Source Development

Look mom, it’s Open Source!!!
   Git repository at entityframework.codeplex.com
   Code under Apache 2.0 license
   Nightly builds available
   Accepting contributions
     Only EF team has commit rights to repo
     Contributions go through same code review process as internal changes
     13 pull requests, 9 accepted
 Currently working to add designer to out Git repo
Only affects how we develop, not how we ship
 Same Microsoft branding, license, quality and support at RTM
EF6 Runtime | Fully Out-Of-Band

EF5 Runtime                             EF6 Runtime
 Core bits in .NET Framework            All classes in NuGet package
   In the GAC                             Core classes copied into new namespace
 Some bits in NuGet package               Most applications should just work with
  (DbContext, Code First, Migrations)       recompile, some namespace changes
                                           Providers, frameworks and tools typically
   Bin-deployable
                                            need more updates
Major features required .NET            All of enums, spatial, TVFs and
Framework Changes!                     EF5 performance
                                        improvements now work on
                                        .NET 4! 
EF6 Runtime | New Features

Async query & save                   Code First improvements
 .NET 4.5 Only                       Custom conventions
Connection resiliency (auto-retry)    CUD stored procedure mapping
Dependency resolution                 Migrations history table
                                       customization
Code-based configuration              Multiple contexts per database
Connection & transaction             More performance improvements
management in DbContext
EF6 Tooling Unification

             Model First & Database First
             (EF Designer)




             Code First – Existing Database
             (EF Power Tools)



     Code First – New Database (No
     Tooling)
Getting EF6
Updating existing applications
Code First Stored Procedure Mapping for CUD
Async Query and Save
Code-based configuration
Custom Code First Conventions
EF6 | Release Timeline

Alpha 3 of the runtime available now on NuGet
 Will keep shipping preview versions every 1 or 2 months
 Nightly builds available from NuGet feed on MyGet
EF 6 Tools preview within next couple of months
RTM
 In the box in Visual Studio vNext
 EF6 Runtime available on NuGet
     Works with VS2010/.NET 4 onwards
 Downloadable tooling update for Visual Studio 2012
Updates to runtime and designer can be shipped between VS releases
Post EF6 potential features - vote @
ef.mswish.net
EF for Windows Store Apps with         More flexible LINQ translation
SQLite for local data                   Implicit boundaries
 Also Windows Phone support?           Expression variables support
Batch updates                          Data caching (2nd level cache)
SQL generation improvements            First class DDD aggregates
More flexible mapping                  Disconnected graphs support
   Mapping to fields                  SQL Federations & Sharding
   Type conversions                   Micro-O/RM-like capabilities
   Shadow state
                                       Unique constraints
   Untyped objects
   Serializing to BLOB columns        Query hints
Lifecycle hooks                        ???
EF | Resources

Learn                            Follow us
 msdn.com/data/ef                  @efmagicunicorns
Contribute                          @divega
 entityframework.codeplex.com      facebook.com/efmagicunicorns
Vote                                blogs.msdn.com/adonet
 ef.mswish.net                     blogs.msdn.com/diego

Deep Dive into Entity Framework 6.0

  • 1.
    Deep Dive into EntityFramework 6 Diego Vega Developer Lead Microsoft
  • 2.
    Deep Dive intoEF6 | Agenda Runtime Open & Release Demo Post EF6 Source Designer details features
  • 3.
    EF Overview |What is EF? • Recommended technology to connect .NET Microsoft’s applications to databases Object/Relational • LINQ against disparate relational databases Mapper • Make .NET & Windows Azure the best platform for data centered apps Product goals • Be the most productive data access API
  • 4.
    EF6 | OpenSource Development Look mom, it’s Open Source!!!  Git repository at entityframework.codeplex.com  Code under Apache 2.0 license  Nightly builds available  Accepting contributions  Only EF team has commit rights to repo  Contributions go through same code review process as internal changes  13 pull requests, 9 accepted  Currently working to add designer to out Git repo Only affects how we develop, not how we ship  Same Microsoft branding, license, quality and support at RTM
  • 5.
    EF6 Runtime |Fully Out-Of-Band EF5 Runtime EF6 Runtime  Core bits in .NET Framework  All classes in NuGet package  In the GAC  Core classes copied into new namespace  Some bits in NuGet package  Most applications should just work with (DbContext, Code First, Migrations) recompile, some namespace changes  Providers, frameworks and tools typically  Bin-deployable need more updates Major features required .NET All of enums, spatial, TVFs and Framework Changes!  EF5 performance improvements now work on .NET 4! 
  • 6.
    EF6 Runtime |New Features Async query & save Code First improvements  .NET 4.5 Only  Custom conventions Connection resiliency (auto-retry)  CUD stored procedure mapping Dependency resolution  Migrations history table customization Code-based configuration  Multiple contexts per database Connection & transaction More performance improvements management in DbContext
  • 7.
    EF6 Tooling Unification Model First & Database First (EF Designer) Code First – Existing Database (EF Power Tools) Code First – New Database (No Tooling)
  • 8.
    Getting EF6 Updating existingapplications Code First Stored Procedure Mapping for CUD Async Query and Save Code-based configuration Custom Code First Conventions
  • 9.
    EF6 | ReleaseTimeline Alpha 3 of the runtime available now on NuGet  Will keep shipping preview versions every 1 or 2 months  Nightly builds available from NuGet feed on MyGet EF 6 Tools preview within next couple of months RTM  In the box in Visual Studio vNext  EF6 Runtime available on NuGet  Works with VS2010/.NET 4 onwards  Downloadable tooling update for Visual Studio 2012 Updates to runtime and designer can be shipped between VS releases
  • 10.
    Post EF6 potentialfeatures - vote @ ef.mswish.net EF for Windows Store Apps with More flexible LINQ translation SQLite for local data  Implicit boundaries  Also Windows Phone support?  Expression variables support Batch updates Data caching (2nd level cache) SQL generation improvements First class DDD aggregates More flexible mapping Disconnected graphs support  Mapping to fields SQL Federations & Sharding  Type conversions Micro-O/RM-like capabilities  Shadow state Unique constraints  Untyped objects  Serializing to BLOB columns Query hints Lifecycle hooks ???
  • 11.
    EF | Resources Learn Follow us  msdn.com/data/ef  @efmagicunicorns Contribute  @divega  entityframework.codeplex.com  facebook.com/efmagicunicorns Vote  blogs.msdn.com/adonet  ef.mswish.net  blogs.msdn.com/diego