BstBulk 10.1.5

BstBulk

Helpers for opting properties into bulk insert/update operations (works with EFCore.BulkExtensions).

This is the provider-agnostic core package — it does not reference a database provider. To run the actual bulk call, install the provider package for your database instead of (or alongside) this one:

  • BstBulk.SqlServer — SQL Server
  • BstBulk.PostgreSql — PostgreSQL

Migration note: Up to version 10.0.x, BstBulk transitively pulled in the SQL Server bulk provider, so BulkInsertOrUpdateAsync worked out of the box. From 10.1.0 it no longer does — SQL Server consumers should switch their package reference from BstBulk to BstBulk.SqlServer.

Usage

1. Mark properties with [Bulk(insert, update)]

using BstBulk.DataAnnotations;

public class Product {
    public int Id { get; set; }

    [Bulk(insert: true, update: true)]
    public string Name { get; set; }

    [Bulk(insert: true, update: false)]
    public DateTimeOffset CreatedAt { get; set; }

    // Owned types in the same table also work — annotate the navigation
    [Bulk(insert: true, update: true)]
    public Address ShippingAddress { get; set; }
}

Properties without [Bulk] are ignored.

2. Build the property lists from the DbContext

using BstBulk.Enums;
using BstBulk.Extensions;

var propertiesToInsert = dbContext.GetBulkProperties<Product>(BulkType.Insert);
var propertiesToUpdate = dbContext.GetBulkProperties<Product>(BulkType.Update);

GetBulkProperties walks the EF model, picks scalar properties whose [Bulk] flag for the requested operation is true, and adds owned-entity columns when the navigation is itself flagged. Owned types nested inside a flagged owned navigation are included automatically — the nested navigations do not need their own [Bulk] annotation.

3. Pass them to the bulk call

With a provider package installed (BstBulk.SqlServer / BstBulk.PostgreSql), let the helpers build the BulkConfig and run the operation for you:

using BstBulk.SqlServer.Extensions; // or BstBulk.PostgreSql.Extensions

await dbContext.BstBulkInsertOrUpdate(products);

The core also exposes GetBulkConfig<T>() if you prefer to build the config and call EFCore.BulkExtensions yourself:

using BstBulk.Extensions;

var config = dbContext.GetBulkConfig<Product>();
config.UpdateByProperties = [nameof(Product.Id)];
await dbContext.BulkInsertOrUpdateAsync(products, config);

GetBulkConfig<T> is equivalent to building a BulkConfig with PropertiesToInclude = GetBulkProperties<T>(BulkType.Insert) and PropertiesToIncludeOnUpdate = GetBulkProperties<T>(BulkType.Update).

BulkType values: BulkType.Insert, BulkType.Update.

Showing the top 20 packages that depend on BstBulk.

Packages Downloads
BstBulk.PostgreSql
Biblioteca para operações bulk no PostgreSQL (EF Core)
0
BstBulk.PostgreSql
Biblioteca para operações bulk no PostgreSQL (EF Core)
8
BstBulk.PostgreSql
Biblioteca para operações bulk no PostgreSQL (EF Core)
12
BstBulk.PostgreSql
Biblioteca para operações bulk no PostgreSQL (EF Core)
14
BstBulk.PostgreSql
Biblioteca para operações bulk no PostgreSQL (EF Core)
57
BstBulk.SqlServer
Biblioteca para operações bulk no SQL Server (EF Core)
0
BstBulk.SqlServer
Biblioteca para operações bulk no SQL Server (EF Core)
8
BstBulk.SqlServer
Biblioteca para operações bulk no SQL Server (EF Core)
10
BstBulk.SqlServer
Biblioteca para operações bulk no SQL Server (EF Core)
11
BstBulk.SqlServer
Biblioteca para operações bulk no SQL Server (EF Core)
12
BstBulk.SqlServer
Biblioteca para operações bulk no SQL Server (EF Core)
16

.NET 10.0

Version Downloads Last updated
10.1.5 1 06/11/2026
10.1.4 9 20/10/2026
10.1.3 9 20/10/2026
10.1.2 10 22/09/2026
10.1.1 20 18/07/2026
10.1.0 52 14/07/2026
10.0.20 24 14/06/2026
10.0.19 32 08/06/2026
10.0.18 22 05/06/2026
10.0.17 20 05/06/2026
10.0.16 20 05/06/2026
10.0.15 18 17/05/2026
10.0.14 22 03/05/2026
10.0.13 31 23/04/2026
10.0.12 25 16/04/2026
10.0.11 26 20/03/2026
10.0.10 29 20/03/2026
10.0.9 29 20/03/2026
10.0.8 27 20/03/2026
10.0.7 29 11/03/2026
10.0.6 24 07/03/2026
10.0.5 30 10/02/2026
10.0.4 27 28/01/2026
10.0.3 29 28/01/2026
10.0.2 27 12/12/2025
10.0.1 31 11/11/2025
9.1.5 35 10/11/2025
9.1.4 27 06/11/2025
9.1.3 29 31/10/2025
9.1.2 27 20/10/2025
9.1.1 26 20/10/2025
9.1.0 29 15/10/2025
9.0.9 28 24/09/2025
9.0.8 33 06/09/2025
9.0.7 35 26/07/2025
9.0.6 39 15/07/2025
9.0.5 34 12/06/2025
9.0.4 40 19/05/2025
9.0.3 34 14/05/2025
9.0.2 37 09/04/2025
9.0.1 38 24/03/2025