EF6 or EF Core

EF Core or EF 6
How Do I Choose?
Julie Lerman
@julielerman
about.me/julielerman
My Courses on
Entity Framework in the Enterprise (Update)
Play by Play: First Look at EF Core
Getting Started with EF6
Domain-Driven Design Fundamentals
Looking Ahead to Entity Framework 7
EF6 Ninja Edition: What’s New in EF6
Automated Testing for Fraidy Cats Like Me
Getting Started with Entity Framework 5
Entity Framework Code First Migrations
Data Layer Validation with Entity Framework 4.1+
Entity Framework 4.1 - DbContext Data Access
Entity Framework 4.1 - Code First
Querying the Entity Framework
Designer Supported EDM Customization
Entity Framework and Data Models
Entity Framework 4.0 By Example
Julie Lerman TheDataFarm.com @julielerman
Important Information
Demos
Prepare/migrate EF6 code
Q&A
Julie Lerman TheDataFarm.com @julielerman
From Entity Framework to EF Core
EF Core 1.0
June 2016
EF
2008
EF4
2010
4.1
2011
5
2012
6
2013
6.13- > 6M downloads
Julie Lerman TheDataFarm.com @julielerman
EF Core 1.1
Q4’16/Q1’17
EF6 or EF Core?
8 Years
6M+ downloads
“battle tested”
V6 brought
advanced features
New features
Cross-platform
New code base
Performance++
Julie Lerman TheDataFarm.com @julielerman
Unified platform
.NET STANDARD LIBRARY
Ready for
Limited Primetime
Stable
Performant
Integrates with ASP.NET Core
Cross Platform
Downsides today
- features
- tooling
- .Net Core is a moving target
Julie Lerman TheDataFarm.com @julielerman
ASP.NET Core
X Platform
EF Core
.NET Core
.NET &
Windows
Unless you are truly
compelled by EF Core
Julie Lerman TheDataFarm.com @julielerman
EF6
ASP.NET Core & EF6
EF6 Features vs EF Core Features
EF6 Feature Set
Limited Parity
New
EF Core >1.1.0
EF Core 1.1.0
EF Core 1.0.0
EF Core >1.1.0
EF Core 1.1.0
EF Core 1.0.0
Never coming to EF Core
Julie Lerman TheDataFarm.com @julielerman
bit.ly/efcoreroadmap
”EF6.x continues to be the best version of EF for a number of
applications until these features are implemented”
No Microsoft EDMX/Designer
Julie Lerman TheDataFarm.com @julielerman
Reverse Engineer in EF Core
EF Core Migrations
scaffold command
Julie Lerman TheDataFarm.com @julielerman
You do not
have to re-learn
everything
Julie Lerman TheDataFarm.com @julielerman
But…
it’s still new
& different
Julie Lerman TheDataFarm.com @julielerman
The Big Q’s
We’re starting a new app.
Should we use EF6 or EF Core?
We’re updating our app.
Should we use EF Core? EF6? Wait?
Julie Lerman TheDataFarm.com @julielerman
New Apps
Existing
“V.1” Comfort?
Feature Decision
.NET Core : EF Core
Migration not Upgrade
Not backwards compat
Missing features
Eliminated features
Don’t, Unless You Must!*
Julie Lerman TheDataFarm.com @julielerman
Biggest Planned Feature Cuts
EDMX Support
ObjectContext API
Entity SQL
Metadata Workspace API
Overly complex mappings
MEST* mapping
Automatic Migrations
*Multiple Entities for Single Type
Julie Lerman TheDataFarm.com @julielerman
EF6
EF Core
Production Ready
Actively Evolving
Visual Designer
*expect 3rd party support
Backwards Compatible
Full .NET Support
*4.5.1 +
.NET Core Support
Lightweight API(s)
Better APIs, New Features
Non-Relational Data
*coming post 1.1
Open-Source (on Github)
Julie Lerman TheDataFarm.com @julielerman
Migrating Code
Simple models and code with Code First, DbContext, Migrations
Julie Lerman TheDataFarm.com @julielerman
Migrating Code
Simple models and code with Code First, DbContext, Migrations
Complex models and code with Code First, DbContext, Migrations
Julie Lerman TheDataFarm.com @julielerman
Migrating Code
Simple models and code with Code First, DbContext, Migrations
Complex models and code with Code First, DbContext, Migrations
Small EDMX models, simple actions, with DbContext
Julie Lerman TheDataFarm.com @julielerman
Migrating Code
Simple models and code with Code First, DbContext, Migrations
Complex models and code with Code First, DbContext, Migrations
Small EDMX models, simple actions, with DbContext
Large EDMX, mappings, not so simple interaction, DbContext
Migrating Code
Simple models and code with Code First, DbContext, Migrations
Complex models and code with Code First, DbContext, Migrations
Small EDMX models, simple actions, with DbContext
Large EDMX, mappings, not so simple interaction, DbContext
ObjectContext, ESQL
Julie Lerman TheDataFarm.com @julielerman
Existing Code
EF6
EF Core
Julie Lerman TheDataFarm.com @julielerman
Build with EF6,
keeping EF Core in mind
Julie Lerman TheDataFarm.com @julielerman
Isolate and Update Parts of Your App
Julie Lerman TheDataFarm.com @julielerman
IData
public Thing GetThatThing()
{
return Data.GetThatThing();
}
EF6.Data : IData
Julie Lerman TheDataFarm.com @julielerman
EFCore.Data : IData
Bottom Line for Near Future
EF Core is best for new, .Net Core apps
Know what is and is not there
Use it if you know it suits you
Be very picky about EF6->EFCore
Use EF6 until EF Core is ready for you
Plan ahead with good design
Julie Lerman TheDataFarm.com @julielerman
Resources
Pluralsight:
Play by Play : EF Core First Look (bit.ly/PS_EFCoreLook)
Coming soon: Getting Started with EF Core
EF Docs: docs.efproject.net
EFCore: github.com/aspnet/entityframework
EF6: github.com/aspnet/entityframework6
Roadmap: bit.ly/efcoreroadmap
Julie Lerman TheDataFarm.com
@julielerman
Julie Lerman
@julielerman
about.me/julielerman