Transformations.Dapper 2.0.0

dotnet add package Transformations.Dapper --version 2.0.0
                    
NuGet\Install-Package Transformations.Dapper -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Transformations.Dapper" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Transformations.Dapper" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Transformations.Dapper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Transformations.Dapper --version 2.0.0
                    
#r "nuget: Transformations.Dapper, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Transformations.Dapper@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Transformations.Dapper&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Transformations.Dapper&version=2.0.0
                    
Install as a Cake Tool

Transformations.Dapper

A practical, problem-first .NET library for resilient Dapper SQL access.

NuGet

📖 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.Core
  • Dapper
  • Microsoft.Data.SqlClient

Part of the Transformations ecosystem. Designed for modern .NET 8+.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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