N.EntityFrameworkCore.Extensions.SqlServer
10.0.5.3
dotnet add package N.EntityFrameworkCore.Extensions.SqlServer --version 10.0.5.3
NuGet\Install-Package N.EntityFrameworkCore.Extensions.SqlServer -Version 10.0.5.3
<PackageReference Include="N.EntityFrameworkCore.Extensions.SqlServer" Version="10.0.5.3" />
<PackageVersion Include="N.EntityFrameworkCore.Extensions.SqlServer" Version="10.0.5.3" />
<PackageReference Include="N.EntityFrameworkCore.Extensions.SqlServer" />
paket add N.EntityFrameworkCore.Extensions.SqlServer --version 10.0.5.3
#r "nuget: N.EntityFrameworkCore.Extensions.SqlServer, 10.0.5.3"
#:package N.EntityFrameworkCore.Extensions.SqlServer@10.0.5.3
#addin nuget:?package=N.EntityFrameworkCore.Extensions.SqlServer&version=10.0.5.3
#tool nuget:?package=N.EntityFrameworkCore.Extensions.SqlServer&version=10.0.5.3
N.EntityFrameworkCore.Extensions.SqlServer
High-performance bulk data extensions for Entity Framework Core — SQL Server provider. Extends your DbContext with bulk operations, query-based DML, CSV export, and utility helpers — all without loading entities into memory.
Supported operations: BulkDelete · BulkFetch · BulkInsert · BulkMerge · BulkSaveChanges · BulkSync · BulkUpdate · Fetch · DeleteFromQuery · InsertFromQuery · UpdateFromQuery · QueryToCsvFile · SqlQueryToCsvFile
Supports: Multiple Schemas · Complex Properties · Value Converters · Transactions · Synchronous & Asynchronous Execution
Inheritance Models: Table-Per-Concrete · Table-Per-Hierarchy · Table-Per-Type
💬 Feedback & Feature Requests Found a bug or have an idea? Please open an issue on GitHub.
Installation
dotnet add package N.EntityFrameworkCore.Extensions.SqlServer
Setup
Call SetupEfCoreExtensions() in your DbContext.OnConfiguring override:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder
.UseSqlServer("your-connection-string")
.SetupEfCoreExtensions();
}
Usage
BulkInsert
var orders = new List<Order>();
for (int i = 0; i < 10000; i++)
orders.Add(new Order { OrderDate = DateTime.UtcNow, TotalPrice = 2.99 });
dbContext.BulkInsert(orders);
await dbContext.BulkInsertAsync(orders);
BulkUpdate
var products = dbContext.Products.Where(o => o.Price < 5.35M).ToList();
foreach (var product in products) product.Price = 6M;
dbContext.BulkUpdate(products);
await dbContext.BulkUpdateAsync(products);
BulkDelete
var orders = dbContext.Orders.Where(o => o.TotalPrice < 5.35M).ToList();
dbContext.BulkDelete(orders);
await dbContext.BulkDeleteAsync(orders);
BulkMerge (Upsert)
BulkMergeResult<Product> result = dbContext.BulkMerge(products);
Console.WriteLine($"Inserted: {result.RowsInserted}, Updated: {result.RowsUpdated}");
BulkSync
BulkSyncResult<Product> result = dbContext.BulkSync(products);
Console.WriteLine($"Inserted: {result.RowsInserted}, Updated: {result.RowsUpdated}, Deleted: {result.RowsDeleted}");
DeleteFromQuery
dbContext.Products.Where(x => x.Price < 5.35M).DeleteFromQuery();
await dbContext.Products.Where(x => x.Price < 5.35M).DeleteFromQueryAsync();
InsertFromQuery
dbContext.Products
.Where(x => x.Price < 10M)
.InsertFromQuery("ProductsUnderTen", o => new { o.Id, o.Price });
UpdateFromQuery
dbContext.Products
.Where(x => x.Price == 5.35M)
.UpdateFromQuery(o => new Product { Price = 5.75M });
Transactions
using var transaction = dbContext.Database.BeginTransaction();
try
{
dbContext.BulkInsert(orders);
dbContext.BulkUpdate(products);
transaction.Commit();
}
catch
{
transaction.Rollback();
}
For full documentation including all options, result objects, and the complete API reference, see the main README.
Donations
- 💳 PayPal: Donate via PayPal
- ₿ Bitcoin:
bc1qxqpymnf4gj22nt4wj3wy56ks48fw59v8y9sg9z
| 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. |
-
net10.0
- Microsoft.Data.SqlClient (>= 7.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on N.EntityFrameworkCore.Extensions.SqlServer:
| Package | Downloads |
|---|---|
|
N.EntityFrameworkCore.Extensions
Meta-package that includes both N.EntityFrameworkCore.Extensions (SQL Server) and N.EntityFrameworkCore.Extensions.PostgreSql (PostgreSql). Extends your DbContext in EF Core with high-performance bulk operations: BulkDelete, BulkInsert, BulkMerge, BulkSync, BulkUpdate, Fetch, DeleteFromQuery, InsertFromQuery, UpdateFromQuery. |
GitHub repositories
This package is not used by any popular GitHub repositories.