Skip to content

Latest news and progress on .NET 8 and EF8 #29989

@ajcvickers

Description

@ajcvickers

July 6, 2023

Highlights

Boolean columns with non-false default values are now handled correctly, including when scaffolded from an existing database. For example, consider this table:

CREATE TABLE [Members] (
    [Id] int NOT NULL IDENTITY,
    [Name] nvarchar(max) NULL,
    [IsActive] bit NOT NULL DEFAULT CAST(1 AS bit),
    CONSTRAINT [PK_Member] PRIMARY KEY ([Id]))

EF8 now parses literal values in column default constraints, allowing HasDefaultValue to be scaffolded instead of HasDefaultValyeSql. For example, CAST(1 AS bit) is parsed as true:

modelBuilder.Entity<Member>(entity =>
{
    entity.Property(e => e.IsActive).HasDefaultValue(true);
});

EF checks the value of a property to determine whether or not to let the database generate a value. Starting with EF8, this check can be customized. This means that EF8 will send false to the database when needed, since database default is known to be true.

In addition:

EF Core 8 (EF8)

EF Core 8 (EF8) will be the next release after EF Core 7.0. It will be released alongside .NET 8 in November 2023.

The EF Core 8 Plan is available publicly in our documentation. As always, feedback is greatly appreciated. This plan is not set-in-stone; we expect it will evolve throughout the release cycle as we learn.

Each high-level area for EF Core 8 is linked in the table below together with its current high-level status.

EF Core 8 Theme Feature Status
Highly requested features JSON columns In-progress
Translate element access of a JSON array Complete
Support for JSON columns in SQLite Complete
Support JSON columns in compiled models Complete
Map collections of primitive types to JSON column in relational database Complete
Map collections of primitive types to JSON column in relational database Complete
Optimize update path for single property element Complete
Use -> and ->> in SQLite instead of json_extract Complete
Value objects In-progress
Raw SQL queries for unmapped types Complete
Support the new BCL DateOnly and TimeOnly structs for SQL Server Complete
Support SQL Server HierarchyID in EF Core Complete
Cloud native and devices AOT and trimming with EF Core In-progress
AOT and trimming for ADO.NET In-progress
NativeAOT/trimming compatibility for Microsoft.Data.Sqlite Complete
Performance Woodstar In-progress
Contains translated to parameterized IN queries Complete
Visual Tooling First-class T4 templates in Visual Studio Cut
EF Core Database First in Visual Studio In-progress
Developer experience Developer experience In-progress
Support querying over primitive collections Complete
Remove unneeded parentheses in SQL queries Complete
Translate ElementAt(OrDefault) Complete
Opt-out of lazy-loading for specific navigations Complete
Lazy-loading for no-tracking queries Complete
Reverse engineer Synapse and Dynamics 365 TDS Complete
Set MaxLength on TPH discriminator property by convention Complete
Translate ToString() on a string column Complete
Generic overload of ConventionSetBuilder.Remove Complete
Lookup tracked entities by primary key, alternate key, or foreign key Complete
Allow UseSequence and HiLo on non-key properties Complete
Pass query tracking behavior to materialization interceptor Complete
Use case-insensitive string key comparisons on SQL Server Complete
Allow value converters to change the DbType Complete
Resolve application services in EF services Complete
Numeric rowersion properties automatically convert to binary Complete
Allow transfer of ownership of DbConnection from application to DbContext Complete
Provide more information when 'No DbContext was found' error is generated Complete

Burndown for EF8

This is the burndown chart the team uses internally to track progress on EF Core 8.

EF8 Burndown
  • The upper chart shows work committed for EF8
  • The lower chart shows work completed for EF8
  • On each chart:
    • Enhancements are in green and are shown at the bottom
    • Bugs are in red and are stacked in the middle
    • Other issues are in blue and stacked at the top

EF Core 8 Preview 5

EF Core 8 (EF8) Preview 5 is available from NuGet

Preview 5 contains the following new features:

In addition, Preview 2 contains the following features from Previews 1, 2, 3, and 4:

See GitHub for all issues resolved in Preview 1, Preview 2, Preview 3, Preview 4, and Preview 5.

EF Core 7.0.8

EF Core 7.0.8 is available on NuGet now.

This is a patch release of EF Core 7.0 containing only updates to dependencies. There are no additional fixes in this release beyond those already shipped in EF Core 7.0.7.

EF Core 7.0.7 was also release since the last new update. It contains the following important bug fixes:

EF Core 6.0.19

EF Core 6.0.19 is available on NuGet now. This is a patch release of EF Core 6 containing only updates to dependencies. There are no additional fixes in this release beyond those already shipped in EF Core 6.0.16.

Pull requests merged since the last update

Community contributions

Many thanks to all our contributors!

EF Core

Builds to use

  • The daily builds are the most up-to-date available.
    • The daily builds now contain all issues merged for 7.0.x patch releases, as well as new code to be released in EF8 previews.
    • The daily builds work on both .NET 6 and .NET 7.
  • Preview: EF Core 8 Preview 5
    • Preview releases lag behind the daily build. We recommend using the daily builds whenever possible.
  • Current: EF Core 7.0.8
  • LTS: EF Core 6.0.19

Releases

See GitHub Releases and EF Core releases and planning (Roadmap) in our documentation for full details.

Weekly/biweekly updates from previous years

Feedback

Comments are disabled on this issue to reduce noise. Please use the related discussion issue for any comments on these status updates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions