If youβve worked with Dapper, you already know how fast and lightweight it is for everyday database operations.
But when it comes to bulk operations β like inserting, updating, or deleting large volumes of data β things can quickly get messy.
Thatβs exactly the problem that led me to create:
π Pignone.Dapper.BulkExtensions
Available on NuGet: https://www.nuget.org/packages/Pignone.Dapper.BulkExtensions
π‘ The Problem
Dapper is great, but it doesnβt provide native support for bulk operations.
This usually leads to:
- Loops executing multiple queries (poor performance)
- Repetitive boilerplate code
- Harder maintenance over time
β The Solution
Pignone.Dapper.BulkExtensions provides a simple and efficient way to handle bulk operations while keeping Dapperβs philosophy:
β Lightweight
β High performance
β Easy to use
β No unnecessary complexity
βοΈ Installation
dotnet add package Pignone.Dapper.BulkExtensions
π₯ Example Usage
using (var connection = new SqlConnection(connectionString))
{
var items = new List<Product>
{
new Product { Name = "Product 1", Price = 10 },
new Product { Name = "Product 2", Price = 20 }
};
await connection.BulkInsertAsync(items);
}
Yes, itβs that simple π
π― When should you use it?
This package is a great fit when you need to:
- Insert large volumes of data
- Improve batch processing performance
- Reduce database round trips
- Keep your Dapper code clean and maintainable
π Project Goals
The goal is to continuously evolve this package to support more bulk operation scenarios in the .NET ecosystem, always focusing on:
- Simplicity
- Performance
- Low coupling
π€ Contributions
Feedback, suggestions, and contributions are very welcome!
If youβve faced challenges with bulk operations using Dapper, Iβd love to hear your experience π
β Support the project
If this package helps you:
- Give it a β on the repository
- Share it with other developers
- Suggest improvements
π Final Thoughts
If youβre using Dapper and need high-performance bulk operations, give Pignone.Dapper.BulkExtensions a try.
Less code. More performance. π₯
Top comments (0)