dotnetConf 2026 (the annual free online .NET conference) featured .NET 10’s improved UUID v7 story as a highlight. With System.Guid.CreateVersion7() fully stabilized and EF Core 10 offering native support, the community is ready to migrate production workloads from Guid.NewGuid() (UUID v4) to UUID v7. See UUID in .NET and C# for the full practical guide.

Event details

ConferencedotnetConf 2026
DateNovember 11–13, 2026
LocationOnline (global)
Focus.NET 10 UUID v7 — Guid.CreateVersion7(), EF Core 10, ASP.NET Core

Key sessions

System.Guid.CreateVersion7() in .NET 10

using System;

// Generate UUID v7
Guid id = Guid.CreateVersion7();
Console.WriteLine(id); // 018fbe3a-4c5d-7b12-8f3e-1a2b3c4d5e6f

// Version and variant
Console.WriteLine(id.Version);  // 7
Console.WriteLine(id.Variant);  // Rfc4122 (same as RFC 9562)

// With explicit timestamp (for testing)
DateTimeOffset ts = new DateTimeOffset(2026, 1, 1, 0, 0, 0, TimeSpan.Zero);
Guid seeded = Guid.CreateVersion7(ts);
Console.WriteLine(seeded); // Timestamp prefix = 2026-01-01

// Sort behavior
var ids = new[] { Guid.CreateVersion7(), Guid.CreateVersion7(), Guid.CreateVersion7() };
Array.Sort(ids); // Chronological order

EF Core 10 with UUID v7

// Order.cs
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

public class Order
{
    [Key]
    public Guid Id { get; set; } = Guid.CreateVersion7();

    [Required]
    public Guid CustomerId { get; set; }

    [Column(TypeName = "decimal(10,2)")]
    public decimal Total { get; set; }

    public string Status { get; set; } = "pending";
    // No CreatedAt — UUID v7 Id encodes creation time
}
// AppDbContext.cs
using Microsoft.EntityFrameworkCore;

public class AppDbContext : DbContext
{
    public DbSet<Order> Orders { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<Order>(e =>
        {
            e.HasKey(o => o.Id);
            e.Property(o => o.Id)
             .HasDefaultValueSql("gen_random_uuid_v7()") // PostgreSQL 18 / pg_uuidv7
             .ValueGeneratedOnAdd();

            // UUID v7 ordering — index on Id gives chronological sort
            e.HasIndex(o => o.Id);
        });
    }
}

ASP.NET Core with UUID v7 route binding

// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<AppDbContext>(opts =>
    opts.UseNpgsql(builder.Configuration.GetConnectionString("Default")));

var app = builder.Build();

// Route binding: Guid works with UUID v7 values directly
app.MapGet("/orders/{id:guid}", async (Guid id, AppDbContext db) =>
{
    var order = await db.Orders.FindAsync(id);
    return order is null ? Results.NotFound() : Results.Ok(order);
});

app.MapPost("/orders", async (CreateOrderRequest req, AppDbContext db) =>
{
    var order = new Order
    {
        // Guid.CreateVersion7() instead of Guid.NewGuid()
        Id = Guid.CreateVersion7(),
        CustomerId = req.CustomerId,
        Total = req.Total,
    };
    db.Orders.Add(order);
    await db.SaveChangesAsync();
    return Results.Created($"/orders/{order.Id}", order);
});

Cursor pagination with UUID v7

app.MapGet("/orders", async (Guid? cursor, AppDbContext db, int limit = 20) =>
{
    var query = db.Orders.OrderBy(o => o.Id);

    if (cursor.HasValue)
    {
        query = (IOrderedQueryable<Order>)query.Where(o => o.Id > cursor.Value);
    }

    var orders = await query.Take(limit).ToListAsync();
    var nextCursor = orders.Count == limit ? orders[^1].Id : (Guid?)null;

    return Results.Ok(new { orders, nextCursor });
});

UUID v7 Guid comparison (>) is chronological because .NET’s Guid type compares the 16 bytes in a defined order and UUID v7’s timestamp is in the most significant bytes. See UUID v7 for Cursor Pagination.

UUID v7 value generator for EF Core

// UuidV7ValueGenerator.cs — application-side generation
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.ValueGeneration;

public class UuidV7ValueGenerator : ValueGenerator<Guid>
{
    public override Guid Next(EntityEntry entry) => Guid.CreateVersion7();
    public override bool GeneratesTemporaryValues => false;
}

// Registration in OnModelCreating:
// e.Property(o => o.Id).HasValueGenerator<UuidV7ValueGenerator>();

Conference takeaways

  1. Replace Guid.NewGuid() with Guid.CreateVersion7() — same type, same APIs, time-ordered output
  2. EF Core 10 supports UUID v7 value generators natively
  3. ASP.NET Core route binding works with UUID v7 via the {id:guid} constraint
  4. No schema migration needed — UUID v7 values fit in existing uniqueidentifier / uuid columns
  5. Sort by Id for chronological order — no CreatedAt column needed for time-ordered queries

Further reading

External references

Frequently asked questions

Does .NET 10 support UUID v7 natively?

Yes. System.Guid.CreateVersion7() was introduced in .NET 9 and stabilized in .NET 10. It generates a UUID v7 with a 48-bit Unix millisecond timestamp and 74 random bits. The returned Guid value works in all existing APIs that accept Guid — EF Core, ASP.NET Core route binding, and JSON serialization. See UUID in .NET and C#.

How does EF Core 10 handle UUID v7 primary keys?

EF Core 10 adds explicit Guid.CreateVersion7() as a value generator option for primary key columns. Configure it with .HasDefaultValueSql("gen_random_uuid_v7()") on PostgreSQL (with pg_uuidv7 or PostgreSQL 18) or use the EF Core value generator on the application side with .HasValueGenerator<UuidV7ValueGenerator>(). See UUID in .NET and C#.

How do I migrate from Guid.NewGuid() to Guid.CreateVersion7() in .NET?

Replace Guid.NewGuid() with Guid.CreateVersion7() at ID generation sites. Existing Guid columns accept UUID v7 values — no schema migration needed. New records sort chronologically by ID; old UUID v4 records appear in random order before all new records. For a clean sort boundary, set a cutover timestamp and filter: WHERE id > @cutoverUuid using a UUID v7 value at the cutover time.