BstBulk 10.0.17

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.

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.18 0 05/06/2026
10.0.17 0 05/06/2026
10.0.16 0 05/06/2026
10.0.15 3 17/05/2026
10.0.14 5 03/05/2026
10.0.13 10 23/04/2026
10.0.12 6 16/04/2026
10.0.11 7 20/03/2026
10.0.10 7 20/03/2026
10.0.9 7 20/03/2026
10.0.8 7 20/03/2026
10.0.7 9 11/03/2026
10.0.6 7 07/03/2026
10.0.5 8 10/02/2026
10.0.4 8 28/01/2026
10.0.3 9 28/01/2026
10.0.2 9 12/12/2025
10.0.1 11 11/11/2025
9.1.5 12 10/11/2025
9.1.4 12 06/11/2025
9.1.3 11 31/10/2025
9.1.2 11 20/10/2025
9.1.1 10 20/10/2025
9.1.0 13 15/10/2025
9.0.9 12 24/09/2025
9.0.8 16 06/09/2025
9.0.7 17 26/07/2025
9.0.6 17 15/07/2025
9.0.5 18 12/06/2025
9.0.4 22 19/05/2025
9.0.3 18 14/05/2025
9.0.2 20 09/04/2025
9.0.1 18 24/03/2025