Transcript
Page 1: Deep Dive into Entity Framework 6.0

Deep Dive into Entity Framework 6Diego VegaDeveloper LeadMicrosoft

Page 2: Deep Dive into Entity Framework 6.0

Deep Dive into EF6 | Agenda

Open Source

Runtime &

Designer

features

Demo Release details

Post EF6

Page 3: Deep Dive into Entity Framework 6.0

EF Overview | What is EF?

Microsoft’s Object/Relational Mapper

• Recommended technology to connect .NET applications to databases

• LINQ against disparate relational databases

Product goals• Make .NET & Windows Azure the best

platform for data centered apps• Be the most productive data access API

Page 4: Deep Dive into Entity Framework 6.0

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 repoOnly affects how we develop, not how we ship Same Microsoft branding, license, quality and support at RTM

Page 5: Deep Dive into Entity Framework 6.0

EF6 Runtime | Fully Out-Of-Band

EF5 Runtime Core bits in .NET Framework

In the GAC Some bits in NuGet package

(DbContext, Code First, Migrations) Bin-deployable

Major features required .NET Framework Changes!

EF6 Runtime All classes in NuGet package

Core classes copied into new namespace

Most applications should just work with recompile, some namespace changes

Providers, frameworks and tools typically need more updates

All of enums, spatial, TVFs and EF5 performance improvements now work on .NET 4!

Page 6: Deep Dive into Entity Framework 6.0

EF6 Runtime | New Features

Async query & save .NET 4.5 OnlyConnection resiliency (auto-retry)Dependency resolutionCode-based configurationConnection & transaction management in DbContext

Code First improvements Custom conventions CUD stored procedure mapping Migrations history table customization Multiple contexts per databaseMore performance improvements

Page 7: Deep Dive into Entity Framework 6.0

EF6 Tooling Unification

Model First & Database First (EF Designer)

Code First – Existing Database (EF Power Tools)

Code First – New Database (No Tooling)

Page 8: Deep Dive into Entity Framework 6.0

EF6 | Demo

Getting EF6Updating existing applicationsCode First Stored Procedure Mapping for CUDAsync Query and SaveCode-based configurationCustom Code First Conventions

Page 9: Deep Dive into Entity Framework 6.0

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 MyGetEF 6 Tools preview within next couple of monthsRTM In the box in Visual Studio vNext EF6 Runtime available on NuGet

Works with VS2010/.NET 4 onwards Downloadable tooling update for Visual Studio 2012Updates to runtime and designer can be shipped between VS releases

Page 10: Deep Dive into Entity Framework 6.0

Post EF6 potential features - vote @ ef.mswish.net

EF for Windows Store Apps with SQLite for local data Also Windows Phone support?Batch updatesSQL generation improvementsMore flexible mapping Mapping to fields Type conversions Shadow state Untyped objects Serializing to BLOB columnsLifecycle hooks

More flexible LINQ translation Implicit boundaries Expression variables supportData caching (2nd level cache)First class DDD aggregatesDisconnected graphs supportSQL Federations & ShardingMicro-O/RM-like capabilitiesUnique constraintsQuery hints???


Recommended