Swevo.EFCore.BulkOperations 1.0.1

Prefix Reserved
dotnet add package Swevo.EFCore.BulkOperations --version 1.0.1
                    
NuGet\Install-Package Swevo.EFCore.BulkOperations -Version 1.0.1
                    
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="Swevo.EFCore.BulkOperations" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Swevo.EFCore.BulkOperations" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Swevo.EFCore.BulkOperations" />
                    
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 Swevo.EFCore.BulkOperations --version 1.0.1
                    
#r "nuget: Swevo.EFCore.BulkOperations, 1.0.1"
                    
#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 Swevo.EFCore.BulkOperations@1.0.1
                    
#: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=Swevo.EFCore.BulkOperations&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Swevo.EFCore.BulkOperations&version=1.0.1
                    
Install as a Cake Tool

EFCore.BulkOperations

NuGet NuGet Downloads CI License: MIT

Free, MIT-licensed bulk insert/update/delete for EF Core. No commercial license required — ever.

Why EFCore.BulkOperations?

SaveChangesAsync sends one round trip per row, which falls over once you need to insert thousands of entities at a time. Commercial libraries like Z.EntityFramework.Extensions solve this well but require a paid license per developer/server. EFCore.BulkOperations gives you the same core capability — high-throughput bulk insert, plus update/delete — fully free and open source under MIT.

using EFCore.BulkOperations;

await dbContext.BulkInsertAsync(orders);

await dbContext.Orders
    .Where(o => o.Status == OrderStatus.Pending)
    .BulkUpdateAsync(setters => setters.SetProperty(o => o.Status, OrderStatus.Cancelled));

await dbContext.Orders
    .Where(o => o.CreatedAt < cutoff)
    .BulkDeleteAsync();

Install

dotnet add package Swevo.EFCore.BulkOperations

How it works

  • BulkInsertAsync — on SQL Server, streams entities straight into SqlBulkCopy (no intermediate DataTable, no per-row SaveChanges round trip). On every other provider (SQLite, InMemory, Npgsql, etc.) it automatically falls back to chunked AddRange + SaveChangesAsync batches with ChangeTracker.Clear() between batches, so the same call works everywhere — just faster on SQL Server.
  • BulkUpdateAsync / BulkDeleteAsync — thin, discoverable wrappers around EF Core's native ExecuteUpdateAsync/ExecuteDeleteAsync, rounding out the bulk-operations API surface under one consistent name.
  • Database-generated columns (identity primary keys, computed columns) are automatically excluded from the insert payload — set BulkInsertOptions.ExcludeDatabaseGeneratedColumns = false to override.
await dbContext.BulkInsertAsync(orders, new BulkInsertOptions
{
    BatchSize = 5000,
    TimeoutSeconds = 60,
});

Roadmap

  • BulkInsertOrUpdateAsync (upsert/merge) is planned for a future 1.1 release. It's deliberately out of scope for 1.0 to ship a well-tested, focused insert/update/delete core first.

Design goals

  • MIT licensed, forever. No commercial tier, no per-seat fees.
  • Same API everywhere. SQL Server gets SqlBulkCopy performance; every other provider gets a correct, tested fallback — you don't need #if branches in your app code.
  • No hard SqlClient dependency at runtime for non-SQL-Server apps — the SQL Server path is only exercised when DbContext.Database.ProviderName reports the SQL Server provider.

💼 Need .NET consulting?

I'm the author of EFCore.BulkOperations and a suite of compile-time source generators (AutoWire, AutoMap.Generator) and 28+ Polly v8 resilience packages. I'm available for consulting on Polly v8 resilience, Azure cloud architecture, and clean .NET design.

→ solidqualitysolutions.com · LinkedIn

Also by the same author

🌐 Full suite overview: swevo.github.io

Package Description
FluentPdf Free, MIT-licensed fluent PDF generation — alternative to QuestPDF's commercial license.
AutoBus Free, MIT-licensed message bus — alternative to MassTransit's commercial license.
AutoArchitecture Free, MIT-licensed compile-time architecture rule enforcement — alternative to NDepend.
AutoAssert Free, MIT-licensed fluent assertions — alternative to FluentAssertions' commercial license.
AutoWire Compile-time DI auto-registration — [Scoped]/[Singleton]/[Transient] generates IServiceCollection registration code.
AutoMap.Generator Compile-time object mapping — [Map(typeof(Dto))] generates ToDto() extension methods.
EFCore.Outbox Transactional outbox pattern for EF Core.
AutoDispatch.Generator Compile-time CQRS dispatcher — free alternative to MediatR's commercial license.
PollyAnalyzers Free Roslyn analyzers for async/resilience anti-patterns — blocking calls, async void, fire-and-forget tasks, swallowed exceptions.
PollyAction Free retry/backoff GitHub Action — wrap any CI step with exponential-backoff retries.

License

MIT © Justin Bannister

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 102 7/7/2026
1.0.0 94 7/7/2026

1.0.1: Add missing package icon. 1.0.0: Initial release. BulkInsertAsync (SqlBulkCopy for SQL Server, chunked fallback for other providers), BulkUpdateAsync, BulkDeleteAsync.