-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
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:
- Major progress on value objects with the merge of Add complex types to Metadata.
- A PR with changes to JSON serialization is out for review
- Unfortunately, the T4 tooling changes planned for Visual Studio have been cut.
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.
Burndown for EF8
This is the burndown chart the team uses internally to track progress on EF Core 8.

- 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:
- SQLite RevEng: Sample data to determine CLR type
- Allow default value check in value generation to be customized
- Update handling of non-nullable store-generated properties
In addition, Preview 2 contains the following features from Previews 1, 2, 3, and 4:
- IN() list queries are not parameterized, causing increased SQL Server CPU usage
- Allow 'unsharing' connection between contexts
- Remove unneeded subquery and projection when using ordering without limit/offset in set operations
- Make SequentialGuidValueGenerator non-allocating
- Support querying over primitive collections
- JSON/Sqlite: use -> and ->> where possible when traversing JSON, rather than json_extract
- Add Generic version of EntityTypeConfiguration Attribute
- NativeAOT/trimming compatibility for Microsoft.Data.Sqlite
- Map collections of primitive types to JSON column in relational database
- Translate DateTimeOffset.ToUnixTime(Seconds|Milliseconds)
- Allow pooling DbContext with singleton services
- Optional RestartSequenceOperation.StartValue
- Generate compiled relational model
- Global query filters produce too many parameters
- Optimize update path for single property JSON element
- JSON columns can be used in compiled models
- Unneeded parentheses removed in SQL queries
- Set operations are supported over non-entity projections with different facets
- Json: add support for Sqlite provider
- SQL Server: Support hierarchyid
- Configuration to opt out of occasionally problematic SaveChanges optimizations
- Add convention types for triggers
- Translate element access of a JSON array
- Raw SQL queries for unmapped types
- Support the new BCL DateOnly and TimeOnly structs for SQL Server
- Translate ElementAt(OrDefault)
- Opt-out of lazy-loading for specific navigations
- Lazy-loading for no-tracking queries
- Reverse engineer Synapse and Dynamics 365 TDS
- Set MaxLength on TPH discriminator property by convention
- Translate ToString() on a string column
- Generic overload of ConventionSetBuilder.Remove
- Lookup tracked entities by primary key, alternate key, or foreign key
- Allow UseSequence and HiLo on non-key properties
- Pass query tracking behavior to materialization interceptor
- Use case-insensitive string key comparisons on SQL Server
- Allow value converters to change the DbType
- Resolve application services in EF services
- Numeric rowersion properties automatically convert to binary
- Allow transfer of ownership of DbConnection from application to DbContext
- Provide more information when 'No DbContext was found' error is generated
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:
- IndexOutOfRangeException in CreateNavigationExpansionExpression
- Linq select cannot project an entity containing both Json columns and ICollections
- Json: updating property with conversion from string to other type fails on sql server
- Duplicate table alias in generated select query (An item with the same key has already been added)
- InvalidOperationException when calling ExecuteUpdate with owned entity & using current value
- Query/Json: projecting entity collection along with json collection generates invalid shaper
- AutoInclude causes ExecuteDelete to fail
- Multiple LeftJoins (GroupJoins) lead to GroupJoin Exception when the same where is used twice
- SaveChanges circular dependency in unique unfiltered index (when change doesn't affect any column from unique index).
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
- @ErikEJ: Add DateOnly.FromDateTime query mapping for SQL Server
- @ErikEJ: Fix FK duplicate detection bug
- @IanKemp: Use ValueTask.FromResult to avoid unnecessarily specifying types
- @tesar-tech: Adds missing ` to execute-insert-update-delete.md
Many thanks to all our contributors!
EF Core
- Query
- Documentation
- Miscellaneous
- Model building
- Scaffolding
- Migrations
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.