Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions ef/efcore-vs-ef6/choosing.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
---
uid: efcore-vs-ef6/choosing
---
Caution: This documentation is for EF Core. For EF6.x and earlier release see [http://msdn.com/data/ef](http://msdn.com/data/ef).
# Which One Is Right for You

# Which One Is Right for You
> [!WARNING]
> This documentation is for EF Core. For EF6.x and earlier release see [http://msdn.com/data/ef](http://msdn.com/data/ef).

The following information will help you choose between Entity Framework Core and Entity Framework 6.x.

## What is EF6.x
## What is EF6.x

Entity Framework 6.x (EF6.x) is a tried and tested data access technology with many years of features and stabilization. It first released in 2008, as part of .NET Framework 3.5 SP1 and Visual Studio 2008 SP1. Starting with the EF4.1 release it has shipped as the [EntityFramework NuGet package](https://www.nuget.org/packages/EntityFramework/) - currently the most popular package on NuGet.org.

EF6.x continues to be a supported product, and will continue to see bug fixes and minor improvements for some time to come.

## What is EF Core
## What is EF Core

Entity Framework Core (EF Core) is a lightweight, extensible, and cross-platform version of Entity Framework. EF Core introduces many improvements and new features when compared with EF6.x. At the same time, EF Core is a new code base and very much a v1 product.

Expand All @@ -23,16 +24,17 @@ The new, extensible, and lightweight core has also allowed us to add some featur

See [Feature Comparison](features.md) for a detailed comparison of how the feature set in EF Core compares to EF6.x.

## Guidance for new applications
## Guidance for new applications

Because EF Core is a new product, and still lacks some critical O/RM features, EF6.x will still be the most suitable choice for many applications.

These are the types of applications we would recommend using EF Core for.
* New applications that do not require features that are not yet implemented in EF Core. Review [Feature Comparison](features.md) to see if EF Core may be a suitable choice for your application.
**These are the types of applications we would recommend using EF Core for.**

* Applications that target .NET Core, such as Universal Windows Platform (UWP) and ASP.NET Core applications. These applications can not use EF6.x as it requires the Full .NET Framework (i.e. .NET Framework 4.5).
* New applications that do not require features that are not yet implemented in EF Core. Review [Feature Comparison](features.md) to see if EF Core may be a suitable choice for your application.

## Guidance for existing EF6.x applications
* Applications that target .NET Core, such as Universal Windows Platform (UWP) and ASP.NET Core applications. These applications can not use EF6.x as it requires the Full .NET Framework (i.e. .NET Framework 4.5).

## Guidance for existing EF6.x applications

Because of the fundamental changes in EF Core we do not recommend attempting to move an EF6.x application to EF Core unless you have a compelling reason to make the change. If you want to move to EF Core to make use of new features, then make sure you are aware of its limitations before you start. Review [Feature Comparison](features.md) to see if EF Core may be a suitable choice for your application.

Expand Down
95 changes: 86 additions & 9 deletions ef/efcore-vs-ef6/features.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
uid: efcore-vs-ef6/features
---
Caution: This documentation is for EF Core. For EF6.x and earlier release see [http://msdn.com/data/ef](http://msdn.com/data/ef).
# Feature Comparison

# Feature Comparison
> [!WARNING]
> This documentation is for EF Core. For EF6.x and earlier release see [http://msdn.com/data/ef](http://msdn.com/data/ef).

The following information will help you choose between Entity Framework Core and Entity Framework 6.x.

## Features not in EF Core
## Features not in EF Core

This is a list of features not currently implemented in EF Core that are likely to impact your ability to use it in a given application. This is by no means an exhaustive list of possible O/RM features, but the features that we feel have the highest impact on developers.

Expand Down Expand Up @@ -55,15 +56,91 @@ This is a list of features not currently implemented in EF Core that are likely

* **Seed data** allows a set of data to be easily upserted to the database.

## Side-by-side comparison
## Side-by-side comparison

The following table compares the features available in EF Core and EF6.x. It is intended to give a high level comparison and does not list every feature, or attempt to give details on possible differences between how the same feature works.

<!-- Creating a Model EF6.x EF Core 1.0.0 Basic modelling (classes, properties, etc.) Yes Yes Conventions Yes Yes Custom conventions Yes Partial Data annotations Yes Yes Fluent API Yes Yes Inheritance: Table per hierarchy (TPH) Yes Yes Inheritance: Table per type (TPT) Yes Inheritance: Table per concrete class (TPC) Yes Shadow state properties Yes Alternate keys Yes Many-to-many: With join entity Yes Yes Many-to-many: Without join entity Yes Key generation: Database Yes Yes Key generation: Client Yes Complex/value types Yes Spatial data Yes Graphical visualization of model Yes Graphical drag/drop editor Yes Model format: Code Yes Yes Model format: EDMX (XML) Yes Reverse engineer model from database: Command line Yes Reverse engineer model from database: VS wizard Yes Incremental update model from database Yes Querying Data EF6.x EF Core 1.0.0 LINQ: Simple queries Stable Stable LINQ:
Moderate queries Stable Stabilizing LINQ: Complex queries Stable In-Progress LINQ: Queries using navigation properties Stable In-Progress "Pretty" SQL generation Poor Yes Mixed client/server evaluation Yes Loading related data: Eager Yes Yes Loading related data: Lazy Yes Loading related data: Explicit Yes Raw SQL queries: Model types Yes Yes Raw SQL queries: Un-mapped types Yes Raw SQL queries: Composing with LINQ Yes Saving Data EF6.x EF Core 1.0.0 SaveChanges Yes Yes Change tracking: Snapshot Yes Yes Change tracking: Notification Yes Yes Accessing tracked state Yes Partial Optimistic concurrency Yes Yes Transactions Yes Yes Batching of statements Yes Stored procedure Yes Detached graph support (N-Tier): Low level APIs Poor Yes Detached graph support (N-Tier): End-to-end Poor Other Features EF6.x EF Core 1.0.0 Migrations Yes Yes Database creation/deletion APIs Yes Yes Seed data Yes
Connection resiliency Yes Lifecycle hooks (events, command interception, ...) Yes Database Providers EF6.x EF Core 1.0.0 SQL Server Yes Yes MySQL Yes Paid only, unpaid coming soon 1 PostgreSQL Yes Yes Oracle Yes Paid only, unpaid coming soon 1 SQLite Yes Yes SQL Compact Yes Yes DB2 Yes Yes InMemory (for testing) Yes Azure Table Storage Prototype Redis Prototype Application Models EF6.x EF Core 1.0.0 WinForms Yes Yes WPF Yes Yes Console Yes Yes ASP.NET Yes Yes ASP.NET Core Yes Xamarin Coming soon 2 UWP Yes -->
| Creating a Model | EF6.x | EF Core 1.0.0 |
| --------------------------------------------------- | ------ | ------------------------------- |
| Basic modelling (classes, properties, etc.) | Yes | Yes |
| Conventions | Yes | Yes |
| Custom conventions | Yes | Partial |
| Data annotations | Yes | Yes |
| Fluent API | Yes | Yes |
| Inheritance: Table per hierarchy (TPH) | Yes | Yes |
| Inheritance: Table per type (TPT) | Yes | |
| Inheritance: Table per concrete class (TPC) | Yes | |
| Shadow state properties | | Yes |
| Alternate keys | | Yes |
| Many-to-many: With join entity | Yes | Yes |
| Many-to-many: Without join entity | Yes | |
| Key generation: Database | Yes | Yes |
| Key generation: Client | | Yes |
| Complex/value types | Yes | |
| Spatial data | Yes | |
| Graphical visualization of model | Yes | |
| Graphical drag/drop editor | Yes | |
| Model format: Code | Yes | Yes |
| Model format: EDMX (XML) | Yes | |
| Reverse engineer model from database: Command line | | Yes |
| Reverse engineer model from database: VS wizard | Yes | |
| Incremental update model from database | Yes | |
| | | |
| **Querying Data** |**EF6.x**| **EF Core 1.0.0** |
| LINQ: Simple queries | Stable | Stable |
| LINQ: Moderate queries | Stable | Stabilizing |
| LINQ: Complex queries | Stable | In-Progress |
| LINQ: Queries using navigation properties | Stable | In-Progress |
| “Pretty” SQL generation | Poor | Yes |
| Mixed client/server evaluation | | Yes |
| Loading related data: Eager | Yes | Yes |
| Loading related data: Lazy | Yes | |
| Loading related data: Explicit | Yes | |
| Raw SQL queries: Model types | Yes | Yes |
| Raw SQL queries: Un-mapped types | Yes | |
| Raw SQL queries: Composing with LINQ | | Yes |
| | | |
| **Saving Data** | **EF6.x** | **EF Core 1.0.0** |
| SaveChanges | Yes | Yes |
| Change tracking: Snapshot | Yes | Yes |
| Change tracking: Notification | Yes | Yes |
| Accessing tracked state | Yes | Partial |
| Optimistic concurrency | Yes | Yes |
| Transactions | Yes | Yes |
| Batching of statements | | Yes |
| Stored procedure | Yes | |
| Detached graph support (N-Tier): Low level APIs | Poor | Yes |
| Detached graph support (N-Tier): End-to-end | | Poor |
| | | |
| **Other Features** | **EF6.x** | **EF Core 1.0.0** |
| Migrations | Yes | Yes |
| Database creation/deletion APIs | Yes | Yes |
| Seed data | Yes | |
| Connection resiliency | Yes | |
| Lifecycle hooks (events, command interception, ...) | Yes | |
| | | |
| **Database Providers** | **EF6.x** | **EF Core 1.0.0** |
| SQL Server | Yes | Yes |
| MySQL | Yes | Paid only, unpaid coming soon 1 |
| PostgreSQL | Yes | Yes |
| Oracle | Yes | Paid only, unpaid coming soon 1 |
| SQLite | Yes | Yes |
| SQL Compact | Yes | Yes |
| DB2 | Yes | Yes |
| InMemory (for testing) | | Yes |
| Azure Table Storage | | Prototype |
| Redis | | Prototype |
| | | |
| **Application Models** | **EF6.x** | **EF Core 1.0.0** |
| WinForms | Yes | Yes |
| WPF | Yes | Yes |
| Console | Yes | Yes |
| ASP.NET | Yes | Yes |
| ASP.NET Core | | Yes |
| Xamarin | | Coming soon 2 |
| UWP | | Yes |

Footnotes:
* ^1 Paid providers are available, unpaid providers are being worked on. The teams working on the unpaid providers have not shared public details of timeline etc.
* <sup>1</sup> Paid providers are available, unpaid providers are being worked on. The teams working on the unpaid providers have not shared public details of timeline etc.

* ^2 EF Core is built to work on Xamarin when support for .NET Standard is enabled in Xamarin.
* <sup>2</sup> EF Core is built to work on Xamarin when support for .NET Standard is enabled in Xamarin.
Loading