You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Guid-backed ID factory to use CreateVersion7 on .NET 9+
The source generator now emits New() for Guid-backed IDs that uses Guid.CreateVersion7() on .NET 9+ and falls back to Guid.NewGuid() on earlier versions. Updated docs and implementation in NewableGuid.cs to match this logic.
-`New()` (parameterless) for `Guid`- and `Ulid`-backed IDs, using `Guid.NewGuid()` / `Ulid.NewUlid()`
103
+
-`New()` (parameterless) for `Guid`- and `Ulid`-backed IDs, using `Guid.CreateVersion7()` on .NET 9+ or `Guid.NewGuid()` on earlier targets / `Ulid.NewUlid()`
104
104
105
105
## Factory Methods
106
106
107
107
```csharp
108
108
// Guid-backed: parameterless New() generates a new GUID
109
-
varuserId=UserId.New(); // new UserId(Guid.NewGuid())
109
+
// On .NET 9+, uses Guid.CreateVersion7(); earlier targets use Guid.NewGuid()
110
+
varuserId=UserId.New(); // new UserId(Guid.CreateVersion7()) on .NET 9+
110
111
varuserId2=UserId.New(someGuid); // new UserId(someGuid)
111
112
112
113
// Ulid-backed: parameterless New() generates a new ULID
0 commit comments