Dapper Plus – Introduction

Library Under Construction (Available at the end of April)

The Dapper Plus Include method allow resolving issues with multiple “ThenBulk[Action]” method.

Example

Without include method (The invoice cannot be chained to last action)

connection.BulkInsert(orders)
          .ThenInsert(order => order.Items)
          .ThenInsert(orderItem => orderItem.Metas)	  
          // Oops! The related invoice cannot be chained.
          //.ThenInsert(orderItemMeta => ...);

With include method

connection.BulkInsert(orders)
          .Include(x => x.ThenInsert(order => order.Items)
                         .ThenInsert(orderItem => orderItem.Metas))
          .Include(x => x.ThenInsert(order => order.Invoice)
                         .ThenInsert(Invoice => invoice.Items));