SQL Server and Azure SQL Updates with EF Core 10

SQL Server and Azure SQL Updates with EF Core 10

posted 2 min read

EF Core 10 was released in November 2025 together with .NET 10 and is an LTS release supported until 2028. This version mainly focuses on better alignment with new SQL Server capabilities rather than introducing radically new concepts.

Below are a few changes that are worth noting from a practical point of view.

Vector data type support

EF Core 10 adds direct support for the vector data type introduced in SQL Server 2025 and Azure SQL. This makes it possible to store embeddings directly in the database without additional workarounds.

A simple entity example looks like this:

public class Blog
{
    public int Id { get; set; }

    [Column(TypeName = "vector(1536)")]
    public SqlVector<float> Embedding { get; set; }
}

Once the embedding is generated on the application side, it can be saved using the standard EF workflow:

context.Blogs.Add(new Blog
{
    Embedding = new SqlVector<float>(embedding)
});

await context.SaveChangesAsync();

Similarity queries can also be written directly in LINQ using EF.Functions.VectorDistance:

var blogs = await context.Blogs
    .OrderBy(b => EF.Functions.VectorDistance("cosine", b.Embedding, queryVector))
    .Take(3)
    .ToListAsync();

This is useful in scenarios such as semantic search or basic recommendation logic, without needing custom SQL or external query layers.

Native JSON data type mapping

With SQL Server 2025, JSON can now be stored using a dedicated json data type. EF Core 10 supports this natively and uses it automatically when the compatibility level allows it.

For example:

public class Blog
{
    public int Id { get; set; }
    public string[] Tags { get; set; }
    public BlogDetails Details { get; set; }
}

public class BlogDetails
{
    public int Viewers { get; set; }
}

Model configuration:

modelBuilder.Entity<Blog>()
    .ComplexProperty(b => b.Details, b => b.ToJson());

With this setup, both Tags and Details are created as json columns in the database.

Querying remains straightforward:

var blogs = await context.Blogs
    .Where(b => b.Details.Viewers > 3)
    .ToListAsync();

EF Core translates this into SQL using the appropriate JSON functions. For domains that already rely on JSON-like structures, this results in cleaner models and fewer mapping concerns.

Naming default constraints

EF Core 10 allows explicitly naming default constraints instead of relying on database-generated names. This can help reduce unnecessary changes in migrations and make schema updates easier to track.

Example:

modelBuilder.Entity<Post>()
    .Property(p => p.CreatedDate)
    .HasDefaultValueSql("GETDATE()", "DF_Post_CreatedDate");

It’s also possible to enable automatic naming across the model:

modelBuilder.UseNamedDefaultConstraints();

This change is mostly about maintainability, especially in projects with long migration histories.

Closing thoughts

EF Core 10 feels like a refinement release rather than a disruptive one. The added support for vector and JSON data types mainly improves how EF integrates with newer SQL Server features, while smaller changes like constraint naming help with long-term maintenance.

3 Comments

2 votes
0
1 vote

More Posts

Implementing Cellular Redundancy: Cross-Cloud Failover with AWS Transit Gateway and Azure ExpressRou

Cláudio Raposo - May 5

EF Core Global Query Filters: A Complete Guide

Spyros - Mar 2, 2025

ASP.NET Core Custom Logger — Save Logs to Database (SQL)

Spyros - Jan 30

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Building a Clean Master-Detail App with Blazor Server, MudBlazor, and EF Core

Spyros - Mar 26
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

7 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!