Dapper Plus Extend your IDbConnection with high-performance bulk operations



Downloads:
106046
Customers:
1000+



What's Dapper Plus?

Dapper Plus extends your IDbConnection with high-performance bulk operations: BulkInsert, BulkUpdate, BulkDelete, BulkMerge, and more.



Do you offer consulting services?

Yes, you can contact us for special requests: info@zzzprojects.com



Where can I find online examples?

Online examples are now available on .NET Fiddle!

Supported Providers

Features

Mapper

Dapper Plus Mapper allow to map the conceptual model (Entity) with the storage model (Database) and configure options to perform Bulk Actions. An entity can be mapped more than once using a MappingKey.

Dapper Plus - Mapper Example
// Easy to use
DapperPlusManager.Entity<Customer>().Table("Customers")
         .Identity(x => x.CustomerID);

// Easy to customize
DapperPlusManager.Entity<Customer>("TheMappingKey").Table("Customers")
         .Identity(x => x.CustomerID)
         .Map(x => new { x.CustomerName, x.ContactName })
         .BatchSize(200);
Run

Bulk Actions

Bulk Actions allow to perform a bulk insert, update, delete or merge and include related child items.

Dapper Plus - Bulk Actions Example
connection.BulkInsert(customers);
connection.BulkMerge(customers);
Run

Also Bulk Actions

Also Bulk Actions allow to perform bulk action with a lambda expression using entities from the last Bulk[Action] or ThenBulk[Action] used.

Dapper Plus - Also Bulk Actions Example
connection.BulkInsert(orders)
          .AlsoBulkInsert(order => order.Items)
          .AlsoBulkInsert(order => order.Invoice)
          .AlsoBulkInsert(order => order.Invoice.Items);

Then Bulk Actions

Then Bulk Actions is similar to Also Bulk Actions but move foward the chaining for the next bulk action.

Dapper Plus - Then Bulk Actions Example
connection.BulkInsert(orders)
          .ThenBulkInsert(order => order.Invoice)
          .ThenBulkInsert(invoice => invoice.Items);

Utilities Actions

The Dapper Plus utilities give you more flexibility to control chaining methods.

Dapper Plus - Include Actions Example
connection.BulkInsert(orders)
    .ThenForEach(order => order.Items.ForEach(y => y.OrderID = order.OrderID))
          .ThenBulkInsert(order => order.Items);