Ido Flatow
Entity Framework Core (EF Core) 1.0
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatowJoin the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
About Me
Senior Architect, Sela Group
Microsoft Regional Director, and an ASP.NET/IIS MVP
Co-author of courses and books
Focus on server, web, and cloud
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Entity Framework Project Status
New runtime components on NuGet
Core runtime components in .NET
Tooling in Visual Studio
Runtime in .NET Framework
Tooling in Visual Studio
Runtime on NuGet
Tooling on Microsoft Download Center
Latest version included in Visual Studio
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Today
Written to target relational databases
EF6.x DLL files are over 5MB
Runs only on full .NET Framework
No support for batch updates
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
EF Core Key Features
Rewritten from the ground up to be lightweight (under 1MB)
New platforms & data stores
IoC friendly and extensible
Optimized query generation
Code-First only
Batching
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
.NET FRAMEWORK .NET CORE XAMARIN
APP
MODELS
BASE
LIBRARIES
New Platforms
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
New Data Stores
Relational & non-relational
Not a magic abstraction
High level services that are useful on all/most stores
Non-common concerns handled by provider extensions
Example providers
Relational (SQL Server, SQLite, Postgres, SQL Compact etc.)
In Memory (for testing)
Azure Table Storage
Redis cache
Just relational providers for v1.0
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Lightweight & Extensible Core
Same top level experience as EF6.x
Still DbContext/DbSet etc.
New core
Core = metadata, change tracking, query pipeline, etc.
Built as a collection of services with dependency injection
Easier to replace/extend services
Replace confusing APIs & behavior
Optimized for memory and CPU usage
Pay-per-play components
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
EF6.x – The End?!
Will continue to be a supported release
Microsoft will continue with bug fixes and small improvements to
the code base
First preview of EF6.2 will be available shortly after EF Core
reaches RTM
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Some New Features
Mixed C#/database eval in LINQ queries
Batch save
SQL query improvements
Shadow state properties
Alternate keys
TrackGraph API
Demo
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
EF Core Basics
Demo
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
LINQ and SQL Query Improvements
Demo
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Simplified Metadata API
Demo
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Extensible Core
Demo
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
New Data Stores
Demo
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
New Features
Demo
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
New Platforms
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
EF Core 1.0 Feature Status (condensed version)
Backlog
Lazy loading
Complex value types
Stored procedure mapping
Data seeding
Update model from database
Many-to-many relationships
without a join entity
Inheritance mapping with TPT and
TPC
Command interception
In Progress
Bug fixing
Performance improvements
LINQ improvements
Documentation and Intellisense
Thrown out
EDMX
Entity SQL
ObjectContext API
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
EF Core & EF6.x
EF6.x will be the right choice for many applications
Carefully evaluate requirements if considering EF Core
Some important features not implemented in 1.0 (e.g. lazy loading,
stored procedure mapping, etc.)
Less mature code base (e.g. LINQ translator has limitations)
EF6.x to EF Core is “port” not “upgrade”
Very basic code will port easily
Many APIs have changed drastically
Beware of behavior differences in similarly named APIs
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
When to Use EF Core?
New applications that do not need the features that are not yet
implemented in EF Core
Applications that target .NET Core, such as Universal Windows
Platform (UWP) and ASP.NET Core applications
Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
Next Steps
Documentation
docs.efproject.net
github.com/aspnet/EntityFramework/wiki/Roadmap
Repositories
github.com/aspnet/EntityFramework
github.com/rowanmiller/Demo-EFCore
Blogs
blogs.msdn.microsoft.com/dotnet
blogs.msdn.com/b/adonet (older)
My demo code
git.io/voYzr

EF Core (RC2)

  • 1.
    Ido Flatow Entity FrameworkCore (EF Core) 1.0 Join the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatowJoin the conversation on Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow
  • 2.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow About Me Senior Architect, Sela Group Microsoft Regional Director, and an ASP.NET/IIS MVP Co-author of courses and books Focus on server, web, and cloud
  • 3.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow Entity Framework Project Status New runtime components on NuGet Core runtime components in .NET Tooling in Visual Studio Runtime in .NET Framework Tooling in Visual Studio Runtime on NuGet Tooling on Microsoft Download Center Latest version included in Visual Studio
  • 4.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow Today Written to target relational databases EF6.x DLL files are over 5MB Runs only on full .NET Framework No support for batch updates
  • 5.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow EF Core Key Features Rewritten from the ground up to be lightweight (under 1MB) New platforms & data stores IoC friendly and extensible Optimized query generation Code-First only Batching
  • 6.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow .NET FRAMEWORK .NET CORE XAMARIN APP MODELS BASE LIBRARIES New Platforms
  • 7.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow New Data Stores Relational & non-relational Not a magic abstraction High level services that are useful on all/most stores Non-common concerns handled by provider extensions Example providers Relational (SQL Server, SQLite, Postgres, SQL Compact etc.) In Memory (for testing) Azure Table Storage Redis cache Just relational providers for v1.0
  • 8.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow Lightweight & Extensible Core Same top level experience as EF6.x Still DbContext/DbSet etc. New core Core = metadata, change tracking, query pipeline, etc. Built as a collection of services with dependency injection Easier to replace/extend services Replace confusing APIs & behavior Optimized for memory and CPU usage Pay-per-play components
  • 9.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow EF6.x – The End?! Will continue to be a supported release Microsoft will continue with bug fixes and small improvements to the code base First preview of EF6.2 will be available shortly after EF Core reaches RTM
  • 10.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow Some New Features Mixed C#/database eval in LINQ queries Batch save SQL query improvements Shadow state properties Alternate keys TrackGraph API
  • 11.
    Demo Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow EF Core Basics
  • 12.
    Demo Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow LINQ and SQL Query Improvements
  • 13.
    Demo Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow Simplified Metadata API
  • 14.
    Demo Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow Extensible Core
  • 15.
    Demo Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow New Data Stores
  • 16.
    Demo Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow New Features
  • 17.
    Demo Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow New Platforms
  • 18.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow EF Core 1.0 Feature Status (condensed version) Backlog Lazy loading Complex value types Stored procedure mapping Data seeding Update model from database Many-to-many relationships without a join entity Inheritance mapping with TPT and TPC Command interception In Progress Bug fixing Performance improvements LINQ improvements Documentation and Intellisense Thrown out EDMX Entity SQL ObjectContext API
  • 19.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow EF Core & EF6.x EF6.x will be the right choice for many applications Carefully evaluate requirements if considering EF Core Some important features not implemented in 1.0 (e.g. lazy loading, stored procedure mapping, etc.) Less mature code base (e.g. LINQ translator has limitations) EF6.x to EF Core is “port” not “upgrade” Very basic code will port easily Many APIs have changed drastically Beware of behavior differences in similarly named APIs
  • 20.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow When to Use EF Core? New applications that do not need the features that are not yet implemented in EF Core Applications that target .NET Core, such as Universal Windows Platform (UWP) and ASP.NET Core applications
  • 21.
    Join the conversationon Twitter: #ndcoslo // @NDC_Conferences // @idoFlatow Next Steps Documentation docs.efproject.net github.com/aspnet/EntityFramework/wiki/Roadmap Repositories github.com/aspnet/EntityFramework github.com/rowanmiller/Demo-EFCore Blogs blogs.msdn.microsoft.com/dotnet blogs.msdn.com/b/adonet (older) My demo code git.io/voYzr

Editor's Notes

  • #19 https://github.com/aspnet/EntityFramework/wiki/Roadmap#features http://www.c-sharpcorner.com/article/new-features-of-entity-framework-7/