BstBulk 10.0.14

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