Free, MIT-licensed bulk insert/update/delete for EF Core. No commercial license required — ever.
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();dotnet add package Swevo.EFCore.BulkOperationsBulkInsertAsync— on SQL Server, streams entities straight intoSqlBulkCopy(no intermediateDataTable, no per-rowSaveChangesround trip). On every other provider (SQLite, InMemory, Npgsql, etc.) it automatically falls back to chunkedAddRange+SaveChangesAsyncbatches withChangeTracker.Clear()between batches, so the same call works everywhere — just faster on SQL Server.BulkUpdateAsync/BulkDeleteAsync— thin, discoverable wrappers around EF Core's nativeExecuteUpdateAsync/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 = falseto override.
await dbContext.BulkInsertAsync(orders, new BulkInsertOptions
{
BatchSize = 5000,
TimeoutSeconds = 60,
});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.
- MIT licensed, forever. No commercial tier, no per-seat fees.
- Same API everywhere. SQL Server gets
SqlBulkCopyperformance; every other provider gets a correct, tested fallback — you don't need#ifbranches 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.ProviderNamereports the SQL Server provider.
| Package | Downloads | Description |
|---|---|---|
| Swevo.EFCore.Outbox | Transactional outbox pattern for EF Core + AutoBus | |
| Swevo.EFCore.StronglyTyped | Compile-time strongly-typed ID generation for | |
| Swevo.EFCore.SoftDelete | Compile-time soft-delete generation for EF Core entities using Roslyn source generators | |
| Swevo.EFCore.Seeding | Fluent, idempotent, dependency-ordered seed data for EF Core | |
| Swevo.EFCore.Pagination | Offset and cursor-based pagination for EF Core | |
| Swevo.EFCore.JsonColumn | Compile-time JSON column configuration for EF Core 8+ — [JsonColumn] on owned navigation properties generates ConfigureJsonColumns(ModelBuilder) with OwnsOne( | |
| Swevo.EFCore.MultiTenant | Compile-time multi-tenancy for EF Core | |
| Swevo.EFCore.RowVersion | Compile-time optimistic concurrency for EF Core — [Optimistic] source generator adds RowVersion property, IOptimisticEntity, and SaveChangesClientWinsAsync / SaveChangesDatabaseWinsAsync retry extensions |
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
🌐 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. |
MIT © Justin Bannister