EfCore.FastExtensions.SqlServer
0.0.13
dotnet add package EfCore.FastExtensions.SqlServer --version 0.0.13
NuGet\Install-Package EfCore.FastExtensions.SqlServer -Version 0.0.13
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.FastExtensions.SqlServer" Version="0.0.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EfCore.FastExtensions.SqlServer" Version="0.0.13" />
<PackageReference Include="EfCore.FastExtensions.SqlServer" />
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.FastExtensions.SqlServer --version 0.0.13
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EfCore.FastExtensions.SqlServer, 0.0.13"
#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.FastExtensions.SqlServer@0.0.13
#: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.FastExtensions.SqlServer&version=0.0.13
#tool nuget:?package=EfCore.FastExtensions.SqlServer&version=0.0.13
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
๐ EF Core Fast Extensions
Entity Framework Core helpers that keep LINQ fully composable while generating optimized SQL for relational databases. The extensions target .NET 10/EF Core 10 and focus on SQL Server with fallbacks for other EF Core providers.
๐ง Features
- โ
ExecuteUpdateJoinAsync(...)โ translate navigation-heavy filters into JOIN-basedUPDATEstatements. - โ
ExecuteDeleteJoinAsync(...)โ remove rows using the same translated JOIN filters. - โ
ExecuteBulkInsertAsync(...)โ bulk copy when using SQL Server, or batchedINSERTstatements for other providers. - โ
IncludeTempTable(...)โ join in-memory collections through temporary tables withINNERorLEFTsemantics. - โ
Async APIs with pure
IQueryablecomposition and no raw SQL strings required from consumers.
๐ฆ Installation
dotnet add package EfCore.FastExtensions.SqlServer
๐ง Usage Examples
Join-based delete
var deleted = await db.Users
.Include(u => u.State)
.ThenInclude(s => s.Country)
.Where(u => u.State!.StateCode == "AB")
.ExecuteDeleteJoinAsync(CancellationToken.None);
Join-based update
var affected = await db.Users
.Include(x => x.State)
.ThenInclude(x => x.Country)
.Where(u => u.Id == 1 && u.State!.Country.Id > 0)
.ExecuteUpdateJoinAsync(
x => x.SetProperty(p => p.Region, p => p.State!.StateName.ToUpper())
);
Bulk insert (SQL Server optimized)
var newUsers = new List<User>
{
new() { Name = "Ada", Email = "ada@example.com" },
new() { Name = "Alan", Email = "alan@example.com" }
};
// Uses SqlBulkCopy on SQL Server, or batched INSERTs for other providers
var inserted = await db.Users.ExecuteBulkInsertAsync(newUsers, batchSize: 2000);
Joining in-memory data via temporary tables
using EfCore.FastExtensions.SqlServer.Enums;
var temporaryScores = new[]
{
new { UserId = 1, Score = 82 },
new { UserId = 2, Score = 91 }
};
var results = await db.Users
.IncludeTempTable(user => user.Id, temporaryScores, score => score.UserId, SqlJoinType.Left)
.ExecuteSelectAsync(user => new { user.Id, user.Email },
(projection, score) => new
{
projection.Id,
projection.Email,
Score = score?.Score ?? 0
});
๐งช Benchmark Snapshot
Performance comparison between EF Core CRUD operations and optimized JOIN extensions (from the SQL Server benchmarks in this repository):
| Method | Mean | Error | StdDev | Median | Allocated |
|---|---|---|---|---|---|
| Native EF Core Update | 9.794 ms | 0.6103 ms | 1.800 ms | 9.753 ms | 475.92 KB |
| ExecuteUpdateJoinAsync (JOIN + SET + WHERE) | 7.001 ms โ | 0.3860 ms | 1.120 ms | 6.552 ms | 149.49 KB โ |
| Native EF Core RemoveRange | 20.866 ms โ | 2.1838 ms | 6.370 ms | 18.531 ms | 3.31 MB โ |
| ExecuteDeleteJoinAsync | 11.131 ms โ | 0.4575 ms | 1.349 ms | 10.975 ms | 138.04 KB โ |
๐ค Contributing
- Fork the repository.
- Create a branch (e.g.,
feature/your-feature). - Commit your code.
- Push and open a Pull Request.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Data.SqlClient (>= 7.0.0-preview2.25289.6)
- Microsoft.EntityFrameworkCore (>= 10.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.