BstBulk 10.0.15

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