BstBulk 10.0.20

BstBulk

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

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

await dbContext.BulkInsertOrUpdateAsync(products, new BulkConfig {
    PropertiesToInclude = propertiesToInsert,
    PropertiesToIncludeOnUpdate = propertiesToUpdate,
    UpdateByProperties = [nameof(Product.Id)]
});

BulkType values: BulkType.Insert, BulkType.Update.

No packages depend on BstBulk.

Version Downloads Last updated
10.0.20 4 14/06/2026
10.0.19 7 08/06/2026
10.0.18 4 05/06/2026
10.0.17 4 05/06/2026
10.0.16 4 05/06/2026
10.0.15 3 17/05/2026
10.0.14 7 03/05/2026
10.0.13 13 23/04/2026
10.0.12 8 16/04/2026
10.0.11 9 20/03/2026
10.0.10 10 20/03/2026
10.0.9 11 20/03/2026
10.0.8 9 20/03/2026
10.0.7 13 11/03/2026
10.0.6 9 07/03/2026
10.0.5 13 10/02/2026
10.0.4 11 28/01/2026
10.0.3 12 28/01/2026
10.0.2 12 12/12/2025
10.0.1 14 11/11/2025
9.1.5 13 10/11/2025
9.1.4 15 06/11/2025
9.1.3 14 31/10/2025
9.1.2 13 20/10/2025
9.1.1 11 20/10/2025
9.1.0 15 15/10/2025
9.0.9 14 24/09/2025
9.0.8 18 06/09/2025
9.0.7 19 26/07/2025
9.0.6 23 15/07/2025
9.0.5 20 12/06/2025
9.0.4 24 19/05/2025
9.0.3 20 14/05/2025
9.0.2 22 09/04/2025
9.0.1 23 24/03/2025