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)