Here's a summary of what's new in Entity Framework Core in this release:
- SQL Server vector search
- SQL Server JSON type support
- Cosmos full-text and hybrid search
- Complex types
- Padding for parameterized collections
Entity Framework Core 10 updates:
EF 10 brings full support for the recently-introduced vector data type and its supporting VECTOR_DISTANCE() function, available on Azure SQL Database and on SQL Server 2025.
To use the vector data type, simply add a .NET property of type SqlVector<float> to your entity type:
public class Blog
{
// ...
[Column(TypeName = "vector(1536)")]
public SqlVector<float> Embedding { get; set; }
}Then, insert embedding data by populating the Embedding property and calling SaveChangesAsync() as usual:
IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator = /* Set up your preferred embedding generator */;
var embedding = await embeddingGenerator.GenerateVectorAsync("Some text to be vectorized");
context.Blogs.Add(new Blog
{
Name = "Some blog",
Embedding = new SqlVector<float>(embedding)
});
await context.SaveChangesAsync();For more information on vector search, see the documentation.
EF 10 fully supports the new JSON data type, available on Azure SQL Database and on SQL Server 2025:
public class Blog
{
public int Id { get; set; }
public string[] Tags { get; set; }
public required BlogDetails Details { get; set; }
}
public class BlogDetails
{
public string? Description { get; set; }
public int Viewers { get; set; }
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Blog>().ComplexProperty(b => b.Details, b => b.ToJson());
}When configured to target SQL Server 2025, EF 10 creates the following table for the above:
CREATE TABLE [Blogs] (
[Id] int NOT NULL IDENTITY,
[Name] nvarchar(max) NOT NULL,
[Tags] json NOT NULL,
[Details] json NOT NULL,
CONSTRAINT [PK_Blogs] PRIMARY KEY ([Id])
);For more information, see the EF what's new page.
EF 10 brings support for the new Cosmos full-text feature:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Blog>(b =>
{
b.Property(x => x.Contents).EnableFullTextSearch();
b.HasIndex(x => x.Contents).IsFullTextIndex();
});
}
var cosmosBlogs = await context.Blogs
.Where(x => EF.Functions.FullTextContains(x.Contents, "cosmos"))
.ToListAsync();The new hybrid search capability, which allows combining full-text and vector search, is also supported:
float[] myVector = /* generate vector data from text, image, etc. */
var hybrid = await context.Blogs.OrderBy(x => EF.Functions.Rrf(
EF.Functions.FullTextScore(x.Contents, "database"),
EF.Functions.VectorDistance(x.Vector, myVector)))
.Take(10)
.ToListAsync();For more information, see the documentation.
EF 10 introduces substantially improved support for complex types, which are designed to map nested types to the database, either via JSON or by mapping their columns to the same table as their container:
modelBuilder.Entity<Customer>(b =>
{
// Maps the columns of ShippingAddress to the Customer table
b.ComplexProperty(c => c.ShippingAddress);
// Maps BillingAddress to a single JSON column in the Customer table
b.ComplexProperty(c => c.BillingAddress, c => c.ToJson());
});Once your nested type has been mapped, it can be fully queried via LINQ and updated via the usual EF mechanisms. Note that while EF has supported nested mapping via owned entity types, complex types represent a better alternative that fixes many of the problems encountered with owned entity types.
Note that this the complex type support was considerably improved after RC1, and many bugs have been fixed for RC2; to use the full extent of the feature, it's advised to wait for RC2.
Building on top of the improved translation for parameterized collection introduced in preview 7 (docs), in RC1 EF also introduces parameter padding, which further optimizes the generated SQL. See the EF what's new page for more details.
The full list of issues completed for RC1 can be found here.