Transformations.Dapper
2.0.0
dotnet add package Transformations.Dapper --version 2.0.0
NuGet\Install-Package Transformations.Dapper -Version 2.0.0
<PackageReference Include="Transformations.Dapper" Version="2.0.0" />
<PackageVersion Include="Transformations.Dapper" Version="2.0.0" />
<PackageReference Include="Transformations.Dapper" />
paket add Transformations.Dapper --version 2.0.0
#r "nuget: Transformations.Dapper, 2.0.0"
#:package Transformations.Dapper@2.0.0
#addin nuget:?package=Transformations.Dapper&version=2.0.0
#tool nuget:?package=Transformations.Dapper&version=2.0.0
Transformations.Dapper
A practical, problem-first .NET library for resilient Dapper SQL access.
📖 Overview
Transformations.Dapper brings the hardened retry semantics of Transformations.Core directly into your ADO.NET and Dapper workflows. Cloud databases (like Azure SQL) regularly drop connections or trigger transient deadlocks. This library automatically identifies retriable SQL error codes and re-executes Dapper queries transparently.
🚀 Why Transformations.Dapper?
Instead of manually catching SqlException everywhere, you can simply swap connection.QueryAsync for connection.QueryWithRetryAsync. The built-in transient fault detector manages the backoff strategy.
💡 Key Features & Examples
1. Resilient Async Queries
Execute your database calls with total peace of mind. If a transient SQL network error occurs, the wrapper will pause with an exponential jittered backoff and try again.
// Wraps Dapper's standard methods
var activeUsers = await connection.QueryWithRetryAsync<User>(
"SELECT * FROM Users WHERE Status = @Status",
new { Status = UserStatus.Active },
retryCount: 3,
initialDelay: TimeSpan.FromMilliseconds(500)
);
2. SqlParameter Bridging
When bridging legacy SqlCommand ecosystems to Dapper, manually converting raw SqlParameter arrays to Dapper's DynamicParameters is tedious.
SqlParameter[] rawParameters = GetLegacyParameters();
// Extracts name, value, dbtype, and direction effortlessly
DynamicParameters dapperParams = SqlParameterBridge.ToDynamicParameters(rawParameters);
await connection.ExecuteAsync("EXEC sp_ProcessParams", dapperParams);
🛠 Advanced Usage
The SqlTransientFaultDetector is exposed publicly. If you have custom SQL Server error codes that you consider transient (e.g. custom throttle warnings), you can configure the internal collection of accepted error numbers to control the resilience engine.
📦 Dependencies
Transformations.CoreDapperMicrosoft.Data.SqlClient
Part of the Transformations ecosystem. Designed for modern .NET 8+.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Dapper (>= 2.1.72)
- Microsoft.Data.SqlClient (>= 7.0.0)
- Transformations.Core (>= 2.0.0)
-
net8.0
- Dapper (>= 2.1.72)
- Microsoft.Data.SqlClient (>= 7.0.0)
- Transformations.Core (>= 2.0.0)
-
net9.0
- Dapper (>= 2.1.72)
- Microsoft.Data.SqlClient (>= 7.0.0)
- Transformations.Core (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 115 | 4/10/2026 |