Introduction to CRUD Operations with Dapper and Dapper Plus

If you’ve been working with Dapper in .NET applications, you already know why it’s one of the most loved micro-ORMs — simple, fast, and incredibly lightweight. It lets developers write raw SQL with minimal overhead and maps query results directly to objects.

However, as your project grows, plain Dapper starts to face a common bottleneck — slow performance in large write operations. Inserting, updating, or deleting thousands of records can result in thousands of database round trips.

That’s where Dapper Plus comes in. It’s an extension library built specifically to enhance Dapper with high-performance bulk operations like BulkInsert, BulkUpdate, BulkDelete, and more.

In this article, we’ll explore how to combine Dapper’s simplicity with Dapper Plus’s power to achieve optimal performance for CRUD operations in .NET using SQL Server.

Read Operation — Dapper’s Simplicity

Dapper is ideal for read operations — it executes queries fast and maps the results to your C# models effortlessly.

C#
var customers = await connection.QueryAsync<Customer>("SELECT * FROM Customers");

foreach (var customer in customers)
{
    Console.WriteLine($"{customer.Id} - {customer.Name} ({customer.Country})");
}

Why Dapper for reads?

  • Extremely lightweight and fast.
  • Provides complete control over SQL.
  • Perfect for small, frequent queries in APIs or web apps.

When it comes to querying data, Dapper remains one of the best-performing libraries in the .NET ecosystem.

Installing Dapper Plus

To enhance Dapper with bulk data operations, you need the Dapper Plus library by ZZZ Projects.

Install it from NuGet:

You can install it using the .NET CLI:

dotnet add package Z.Dapper.Plus

Or from the Package Manager Console in Visual Studio:

Install-Package Z.Dapper.Plus

Once installed, you’ll gain access to powerful methods like:

  • BulkInsert
  • BulkUpdate
  • BulkDelete
  • BulkMerge
  • BulkSynchronize

These bulk operations are designed to handle large-scale CRUD operations efficiently — reducing query times from minutes to seconds.

Create Operation — BulkInsert

Plain Dapper executes each insert individually, which is fine for small datasets but inefficient for large volumes. With Dapper Plus BulkInsert, you can insert thousands of records in one optimized operation.

C#
using Z.Dapper.Plus;

var newCustomers = GenerateCustomers(10_000);

// Perform bulk insert
await connection.BulkInsertAsync<Customer>(newCustomers);

Console.WriteLine("10,000 customers inserted successfully!");

Benefits of BulkInsert:

  • Executes all inserts in one database command.
  • Reduces network latency and command overhead.

Update Operation — BulkUpdate

Updating thousands of records with Dapper usually requires a loop — which is slow and resource-intensive. Dapper Plus fixes that with the BulkUpdate method.

C#
using Z.Dapper.Plus;

// Get customers to update
var existingCustomers = GetCustomers();

// Update country
foreach (var customer in existingCustomers)
{
    customer.Country = "Canada";
}

// Perform bulk update
await connection.BulkUpdateAsync(existingCustomers);

Console.WriteLine("10,000 customers updated successfully!");

Why it’s faster:

  • Executes updates in a single transaction.
  • Optimized SQL generation for batch processing.

Delete Operation — BulkDelete

Deleting large datasets is another area where Dapper Plus BulkDelete shines.

C#
using Z.Dapper.Plus;

// Get customers to delete
var customersToDelete = GetCustomers();

// Perform bulk delete
await connection.BulkDeleteAsync(customersToDelete);

Console.WriteLine("10,000 customers deleted successfully!");

It performs all deletions in a single optimized batch operation. This not only improves speed but also reduces database load.

Additional Bulk Methods in Dapper Plus

Dapper Plus provides more than just the standard CRUD operations. Here are some advanced methods designed for real-world enterprise needs:

BulkMerge

Performs insert or update in one go — similar to SQL’s MERGE command.

C#
using Z.Dapper.Plus;

// Perform bulk merge
await connection.BulkMergeAsync(customersToMerge);

Use BulkMerge for upsert operations where you want to avoid duplicate inserts.

BulkSynchronize

BulkSynchronize keeps your entity list and database table in perfect sync. It inserts new records, updates existing ones, and deletes those that no longer exist.

C#
using Z.Dapper.Plus;

// Perform bulk synchronize
await connection.BulkSynchronizeAsync(customersToSync);

Ideal for data imports, ETL processes, or system syncs.

Supported Databases

Dapper Plus supports a wide range of popular database providers:

  • Microsoft SQL Server
  • Azure SQL Server
  • PostgreSQL
  • MySQL
  • MariaDB
  • SQLite
  • Oracle

This flexibility means you can use the same performance benefits across different database environments.

Free Single Method Edition

One of the great things about Dapper Plus is that it also includes a completely free edition for individual operations, no license required

This edition lets developers use single-record extensions that behave like the bulk methods but operate on one entity at a time. They’re a perfect way to explore the Dapper Plus API or use it in smaller projects without any cost or restrictions, even commercial ones.

You can freely use the following single-operation methods:

  • SingleInsert – Inserts a single row into the database.
  • SingleUpdate – Updates an existing record.
  • SingleDelete – Removes a single record.
  • SingleMerge – Performs an upsert (update if it exists, insert if it doesn’t).

These single methods offer the same syntax and convenience as their bulk equivalents but trade massive throughput for universal availability.

Chaining Methods in Dapper Plus

Dapper Plus supports method chaining, allowing you to execute multiple bulk actions in a fluent, readable way.

There are four types of chaining methods:

  • AlsoBulk[Action] – Performs additional bulk actions at the same level, e.g., insert and update together.
  • ThenBulk[Action] – Executes bulk operations on child or grandchild entities.
  • Include – Groups multiple bulk actions into one logical batch.
  • ThenForEach – Performs custom actions for each entity, like logging or handling identity propagation.

Dapper Plus Performance — How Fast Is It Really?

When it comes to performance, Dapper Plus doesn’t just improve speed — it completely transforms it.

The benchmarks published by ZZZ Projects show just how much faster bulk operations can be compared to plain Dapper.

Here’s what the official tests reveal:

And this isn’t just theory, I ran my own local benchmarks on SQL Server with .NET 9 using 10,000 records, and the results were fully consistent with the official findings.

OperationDapperDapper PlusPerformance Gain
Insert4,878.4 ms222.0 ms24× faster
Update4,294.8 ms269.1 ms15 x faster
Delete5,394.7 ms116.4 ms46 x faster

Note: Actual benchmark results can vary depending on hardware, database engine, and configuration.

Summary

Dapper remains one of the best micro-ORMs for developers who value simplicity and control. It’s lightweight, flexible, and excellent for querying data.
However, when it comes to handling large-scale data operations, Dapper alone can become inefficient.

That’s where Dapper Plus comes in. It enhances Dapper with optimized bulk operations, method chaining, and multi-database support, giving developers the tools to handle high-volume data without sacrificing maintainability or performance.

With Dapper Plus, operations that once took minutes now complete in seconds — all while keeping the same clean Dapper syntax.

Takeaways

  • Dapper = Great for fast, lightweight read operations.
  • Dapper Plus = Built for high-performance bulk writes.
  • Supports: BulkInsert, BulkUpdate, BulkDelete, BulkMerge, and BulkSynchronize.
  • Compatible with SQL Server, PostgreSQL, MySQL, MariaDB, SQLite, and Oracle.
  • Offers method chaining for clean and complex data workflows.
  • Achieves 10x–15x faster performance on large datasets.
  • The perfect combination for modern, performance-driven .NET applications.

Found this article useful? Share it with your network and spark a conversation.