Last Updated on December 3, 2025 by Aram
Today, we will be diving deep beyond the basics of Dapper Plus and exploring how we can customize its powerful bulk methods to fit your requirements.
In a previous tutorial, we learned about Dapper Plus and its key feature, Bulk Extensions. We got introduced to the different extension methods that would allow you to achieve blazing-fast bulk operations.
Special thanks for ZZZ Projects for sponsoring this article, and for delivering and continuously maintaining Dapper Plus along with a list of other useful libraries.
Dapper Plus provides you with over 100 options to control how commands are sent and how data is stored in your database provider.
To view the complete list of options, you can check this link from Dapper Plus Options Page.
These options enable you build highly-flexible .NET Solutions while still offering you the most powerful feature of Dapper Plus – the fastest bulk operations library in .NET.
Dapper Plus Options can be applied on both Single and Bulk Extension Methods, so the power is yours to control all your commands.
Remember that Dapper Plus is a standalone library, so you don’t need Dapper to run it. But ultimately in real applications, you will usually require to provide both read and write operations, in that case, you can have both Dapper and Dapper Plus running side-by-side without any problem.
Dapper Plus adds bulk operations to both IDbConnection and IDbTransaction, so you can utilize the powerful bulk extensions along with any operations or configurations that come alongside.
To start using Dapper Plus, just import its NuGet package and it will be there ready for your consumption:

2 Ways to Utilize Dapper Plus Options
Before we start learning about the top options used to customize Dapper Plus, you should know about the 2 ways that you can use to configure Dapper Plus Options:
In the Entity Mapping
Set options once in the entity mapping, and all bulk operations for that entity follow them.
|
1 2 3 4 5 6 7 8 9 10 |
DapperPlusManager .Entity<Post>() .Table("Post") .Identity(x => x.ID) .UseBulkOptions(x => { x.AutoMapOutputDirection = true; }); // connection setup removed for brevity connection.BulkInsert(posts); |
On the Connection/Transaction
Set options on the connection or transaction to apply them to all bulk operations run through it.
|
1 2 3 4 5 6 7 8 |
var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServer()); connection.CreateTable<Post>(); // InsertIfNotExists connection.UseBulkOptions(x => x.InsertIfNotExists = true ) .BulkInsert(posts); |
Top Dapper Plus Options
So let’s get introduced to the top Options provided as part of Dapper Plus:
InsertIfNotExists
When true, this option skips duplicates automatically.
It is useful for data sync, imports, and preventing duplicate rows.
|
1 2 3 4 |
connection.UseBulkOptions(x => x.AllowDuplicateKeys = true ) .BulkInsert(posts); |
InsertKeepIdentity
Use this option to preserve identity values.
It helps when migrating data or maintaining external IDs.
|
1 2 3 4 |
connection.UseBulkOptions(x => x.InsertKeepIdentity = true ) .BulkInsert(posts); |
AllowDuplicateKeys
Continue execution even when duplicate keys exist.
Useful during partial imports or when some conflicts are acceptable.
|
1 2 3 4 |
connection.UseBulkOptions(x => x.AllowDuplicateKeys = true ) .BulkInsert(posts); |
AutoMapOutputDirection
When this option is true, it tells Dapper Plus to map output values (like identity columns) back into your entities.
|
1 2 3 4 |
connection.UseBulkOptions(x => x.AutoMapOutputDirection = true ) .BulkInsert(posts); |
Note that you have to set your identity field while you setup the mapping for the entity.
|
1 2 3 4 5 6 7 8 9 10 |
DapperPlusManager .Entity<Post>() .Table("Post") .Identity(x => x.ID) .UseBulkOptions(x => { x.AutoMapOutputDirection = true; }); // connection setup removed for brevity connection.BulkInsert(posts); |
BatchSize
This gives you the control on memory and performance.
With BatchSize option, you can easily tune how many rows are processed per batch.
Very useful for large datasets.
|
1 2 3 4 |
connection.UseBulkOptions(x => x.BatchSize = 1000 ) .BulkInsert(posts); |
Log
Collect all SQL generated or log diagnostic info.
Great for debugging SQL, performance, and errors.
|
1 2 3 4 |
connection.UseBulkOptions(x => x.Log = (s) => Console.WriteLine(s) ) .BulkInsert(posts); |

Combining Multiple Options
You can easily combine multiple options in a single UseBulkOptions method, just include your options within the block curly brackets when writing your lambda, and suffix each line with a semi colon.
|
1 2 3 4 5 6 7 8 |
connection.UseBulkOptions(x => { x.BatchSize = 1000; x.BatchTimeout = 30; // seconds x.Log = (s) => Console.WriteLine(s); x.InsertKeepIdentity = true; } ) .BulkInsert(posts); |
Live Examples for Dapper Plus Options
If you want to see and test all the options above live in action, you can check this DotNetFiddle.
DotNetFiddle is another brilliant product and online tool introduced by ZZZ projects that allow you to write and run C# code right into your browser, no IDEs no text editors required, just your favorite browser.
It is one of the most useful tools for developers to test C# and .NET code in no-time.
Complete 100+ Options
You can find the full list of 100+ options in the options page of Dapper Plus Docs
There are options for every single type of bulk operations, in addition to other options covering miscellaneous requirements.
With this huge list of options you get precise control over how bulk operations run, through options like identity handling, batching, temporary tables, logging, and output mapping.
Final Thoughts
Dapper Plus is an amazing library that provides you with strong methods for bulk operations along with the ability to fully control how these bulk operations are sending the commands to the connected database provider.
These features help you tune performance, avoid data issues, and adapt bulk actions to your exact needs, whether you’re importing thousands of rows or running complex enterprise workflows.
Try Dapper Plus today
References
Recent Articles
Exploring Dynamic LINQ and C# Eval Expression
Exploring Bulk Operations in EF Core
7 Types of Authorization in ASP.NET Core Web API
Structured Logging in ASP.NET Core
Bonus
Dedicating some of my favorite musical pieces by the brilliant W.A. Mozart for my amazing readers to enjoy while learning about the wonders of Dapper Plus.
Mozart – Violin Concertos Nos.3,4,5,1,2 & Rondo + Presentation (reference record. : David Oistrakh)
Happy Learning and Listening
