Start Debugging

EF Core 11

67 posts · Page 1 of 7

Why does EF Core forbid concurrent reads on one DbContext, even with AsNoTracking?

A read is not read-only inside a DbContext: every query mutates the shared connection, its open counter, the command and reader state, and for tracking queries the identity map. With thread-safety checks turned off on EF Core 11.0.0, parallel AsNoTracking queries on one context still failed up to 57 times in 1,000 rounds, and tracking queries left a corrupted change tracker in all but one of the rounds that finished.

What Decides Whether EF Core Scaffolds a SQL Server `date` Column as `DateOnly` or `DateTime`?

The EF Core version of the SQL Server provider in your startup project decides it: EF Core 7 and earlier scaffold date as DateTime, EF Core 8 through 11 scaffold it as DateOnly. Here is the type mapping that makes the call, measured output from EF Core 7, 8, 10, and 11 RC 2, and the two ways to get DateTime back without silently remapping the column to datetime2.
Next