VOOZH about

URL: https://www.nuget.org/packages/EFCore.SqlServer.VectorSearch/

⇱ NuGet Gallery | EFCore.SqlServer.VectorSearch 9.0.0




EFCore.SqlServer.VectorSearch 9.0.0

dotnet add package EFCore.SqlServer.VectorSearch --version 9.0.0
 
 
NuGet\Install-Package EFCore.SqlServer.VectorSearch -Version 9.0.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EFCore.SqlServer.VectorSearch" Version="9.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EFCore.SqlServer.VectorSearch" Version="9.0.0" />
 
Directory.Packages.props
<PackageReference Include="EFCore.SqlServer.VectorSearch" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EFCore.SqlServer.VectorSearch --version 9.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EFCore.SqlServer.VectorSearch, 9.0.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EFCore.SqlServer.VectorSearch@9.0.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EFCore.SqlServer.VectorSearch&version=9.0.0
 
Install as a Cake Addin
#tool nuget:?package=EFCore.SqlServer.VectorSearch&version=9.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

EFCore.SqlServer.VectorSearch

Starting with EF 10, the SQL Server provider contains full, built-in support for vector search. This plugin is no longer needed for EF 10 and above. Only use this plugin with EF 8 and 9.

This Entity Framework Core plugin provides integration between older versions of EF and Vector Support in Azure SQL Database and SQL Server 2025, allowing LINQ to be used to perform vector similarity search, and seamless insertion/retrieval of vector data.

To use the plugin, reference the EFCore.SqlServer.VectorSearch nuget package, and enable the plugin by adding UseVectorSearch() to your UseSqlServer() or UseAzureSql() config as follows:

builder.Services.AddDbContext<ProductContext>(options =>
 options.UseSqlServer("<connection string>", o => o.UseVectorSearch()));

Once the plugin has been enabled, add an ordinary float[] property to the .NET type being mapped with EF:

public class Product
{
 public int Id { get; set; }
 public float[] Embedding { get; set; }
}

Finally, configure the property to be mapped as a vector by letting EF Core know using the HasColumnType method. Use the vector type and specify the number of dimension that your vector will have:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
 modelBuilder.Entity<Product>().Property(p => p.Embedding).HasColumnType("vector(3)");
}

That's it - you can now perform similarity search in LINQ queries! For example, to get the top 5 most similar products:

var someVector = new[] { 1f, 2f, 3f };
var products = await context.Products
 .OrderBy(p => EF.Functions.VectorDistance("cosine", p.Embedding, someVector))
 .Take(5)
 .ToArrayAsync();

A full sample using EF Core and vectors is available here:

The function (in preview) for approximate search with DiskANN is not supported.

Azure SQL DB Vector Samples - EF-Core Sample

Ideas? Issues? Let us know on the issues page.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EFCore.SqlServer.VectorSearch:

Package Downloads
ImmediaC.SimpleCms

ASP.NET Core based CMS

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on EFCore.SqlServer.VectorSearch:

Repository Stars
Azure-Samples/eShopLite
eShopLite is a set of reference .NET applications implementing an eCommerce site with features like Semantic Search, MCP, Reasoning models and more.
Version Downloads Last Updated
9.0.0 20,976 9/7/2025
9.0.0-preview.2 22,647 1/16/2025
9.0.0-preview.1 2,729 1/14/2025
8.0.0 4,278 9/7/2025
8.0.0-preview.1 570 1/14/2025
0.2.0 10,333 10/30/2024
0.1.1 776 5/30/2024
0.1.0 238 5/24/2024