Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Start Debugging

sql-server

31 posts · Page 1 of 4

2026-12-03 csharpdotnetguid

Is Guid.CreateVersion7() sequential in .NET? Why two v7 GUIDs compare out of order

Guid.CreateVersion7() puts a millisecond timestamp in the top 48 bits and random data everywhere else, so two values created in the same millisecond come out in random order. Measured on .NET 11.0.0: 50% of back-to-back pairs are out of order, SQL Server sorts v7 values as if they were random, and EF Core only uses v7 by default on Npgsql. How to get a strictly monotonic UUIDv7 and how to opt in per EF Core provider.

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.