ContextBulkExtension.SqlServer.v8
8.0.20
dotnet add package ContextBulkExtension.SqlServer.v8 --version 8.0.20
NuGet\Install-Package ContextBulkExtension.SqlServer.v8 -Version 8.0.20
<PackageReference Include="ContextBulkExtension.SqlServer.v8" Version="8.0.20" />
<PackageVersion Include="ContextBulkExtension.SqlServer.v8" Version="8.0.20" />
<PackageReference Include="ContextBulkExtension.SqlServer.v8" />
paket add ContextBulkExtension.SqlServer.v8 --version 8.0.20
#r "nuget: ContextBulkExtension.SqlServer.v8, 8.0.20"
#:package ContextBulkExtension.SqlServer.v8@8.0.20
#addin nuget:?package=ContextBulkExtension.SqlServer.v8&version=8.0.20
#tool nuget:?package=ContextBulkExtension.SqlServer.v8&version=8.0.20
EF Core Bulk Extension
High-performance bulk operations for Entity Framework Core using SQL Server's SqlBulkCopy.
Installation
Install the NuGet package that matches your EF Core version:
# For EF Core 8.x
dotnet add package ContextBulkExtension.SqlServer.v8
Package Structure
This library provides separate NuGet packages for different EF Core versions and providers:
- ContextBulkExtension.SqlServer.v8 - For Entity Framework Core 8.x with SQL Server
- ContextBulkExtension.SqlServer.v9 - For Entity Framework Core 9.x with SQL Server (coming soon)
- ContextBulkExtension.Postgres.v8 - For Entity Framework Core 8.x with PostgreSQL (coming soon)
Each package pins a specific EF Core version to ensure compatibility. Choose the package that matches your EF Core version.
Usage
1. Insert Only
DbContext db = GetYourDbContext();
await db.BulkInsertAsync(entities);
2. Upsert with Default Compare
DbContext db = GetYourDbContext();
await db.BulkMergeAsync(entities);
Compares by primary key and updates all properties.
3. Upsert with Advanced Usage
DbContext db = GetYourDbContext();
await db.BulkMergeAsync(
entities,
onCompare: x => new { x.Email, x.Username },
updateProperties: x => new { x.LastLogin, x.Status }
);
Compares by Email and Username, updates only LastLogin and Status properties.
Publishing New Versions
Prerequisites
- Trusted Publishing Setup on nuget.org:
- Log into nuget.org
- Navigate to your account settings → Trusted Publishing
- Add a new trusted publishing policy:
- Repository Owner: Your GitHub username/org
- Repository:
ContextBulkExtension(or your actual repo name) - Workflow File:
publish-nuget.yml - Environment: (leave empty if not using environments)
Publishing Process
Option 1: Using PowerShell Script (Recommended)
Use the automated script to publish a new version:
# Publish version 1.0.0
.\scripts\publish-nuget.ps1 -Version "1.0.0"
# Dry run to see what would happen
.\scripts\publish-nuget.ps1 -Version "1.0.0" -DryRun
# Skip build and tests (if already verified)
.\scripts\publish-nuget.ps1 -Version "1.0.0" -SkipBuild -SkipTest
The script will:
- Update
BaseVersioninNugetPackages/Directory.Build.props - Build the projects (unless
-SkipBuildis specified) - Run tests (unless
-SkipTestis specified) - Create a git tag (e.g.,
v1.0.0) - Push the tag to remote, which triggers the GitHub Actions workflow
Option 2: Manual Process
Update
BaseVersioninNugetPackages/Directory.Build.props:<BaseVersion>1.0</BaseVersion>Create and push a git tag:
git tag -a v1.0.0 -m "Release version 1.0.0" git push origin v1.0.0The GitHub Actions workflow will automatically:
- Build the packaging projects
- Pack the NuGet packages
- Authenticate using Trusted Publishing (OIDC)
- Publish to nuget.org
Option 3: Manual Workflow Dispatch
- Go to the Actions tab in GitHub
- Select Publish NuGet Package workflow
- Click Run workflow
- Enter the version (e.g.,
1.0.0) - Click Run workflow
Version Tag Format
Tags must follow semantic versioning: v1.0.0, v1.0.1, v2.0.0, etc.
The workflow extracts the version number (without the 'v' prefix) and sets it as BaseVersion in Directory.Build.props. The final package version will be 8.{BaseVersion} for EF Core 8.x packages (e.g., 8.1.0).
Roadmap
- BulkMerge
- Identity output
- Benchmark with large dataset and table with 20+ columns
| Product | Versions 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. |
-
net8.0
- ContextBulkExtension (>= 1.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.20)
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 | |
|---|---|---|---|
| 8.0.20 | 284 | 11/9/2025 |