---
title: "Discussion on \"Basic Dapper Resiliency Using Polly\" | Hashnode"
description: "Discussion on \"Basic Dapper Resiliency Using Polly\". Background\nDapper is a lightweight ORM for use in high performance database transactions that uses hand written SQL scripts and transforms the results into objects. This approach makes interacting with a database both performant and easy, as you can ..."
url: "https://hashnode.com/posts/basic-dapper-resiliency-using-polly/60bd0ae2fffc4c13b9cd804c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Basic Dapper Resiliency Using Polly](https://concurrentflows.com/basic-dapper-resiliency-using-polly?utm_source=hashnode&utm_medium=feed)

Background Dapper is a lightweight ORM for use in high performance database transactions that uses hand written SQL scripts and transforms the results into objects. This approach makes interacting with a database both performant and easy, as you can ...

Jun 6, 2021 · 10 min read · concurrentflows.com  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)
-   [#database](https://hashnode.com/tag/database)
-   [#development](https://hashnode.com/tag/development)
-   [#dependency-injection](https://hashnode.com/tag/dependency-injection)

## Written by

[Joshua Steward](https://hashnode.com/@jsteward)

@jsteward · Arizona, US

  
[View profile](https://hashnode.com/@jsteward)

Solution Architect

Engineering leader specializing in distributed event driven architectures, with a proven track record of building and mentoring high performing teams. My core expertise lies in dotnet/C#, modern messaging platforms, and Microsoft Azure, where I've architected and implemented highly scalable and available solutions. Explore my insights and deep dives into event driven architecture, patterns, and practices on my platform https://concurrentflows.com/. Having led engineering teams in collaborative and remote-first environments, I prioritize mentorship, clear communication, and aligning technical roadmaps with stakeholder needs. My leadership foundation was strengthened through experience as a Sergeant in the U.S. Marine Corps, where I honed skills in team building and operational excellence.

## Responses 4

Markdown supported · ⌘↵ to post

[santosh kumar patro](https://hashnode.com/@santosh83)

[Oct 15, 2022](https://hashnode.com/posts/basic-dapper-resiliency-using-polly/60bd0ae2fffc4c13b9cd804c/comment/634a3b2f7b9ff55063441670)

Hi Joshua Steward,

After digging deep I figured out that it was a minor mistake from my side. I was not referencing the method: AddSqlDapperClient() in my Startup.cs class as part of DI registration process. I made the change and validated it and found working fine as expected :)

Thanks again for your wonderful awesome great article on Dapper and Polly.

Thanks, Santosh

[Joshua Steward](https://hashnode.com/@jsteward)

[Oct 15, 2022](https://hashnode.com/posts/basic-dapper-resiliency-using-polly/60bd0ae2fffc4c13b9cd804c/comment/634a3b2f7b9ff55063441670#reply-634b03a4f07be352b6a7536c)

Glad you got things figured out, here's the code for this post [GitHub ConcurrentFlows.HashNode](https://github.com/ptsteward/ConcurrentFlows.HashNode/tree/master/ConcurrentFlows.DapperResiliency)

[santosh kumar patro](https://hashnode.com/@santosh83)

[Oct 14, 2022](https://hashnode.com/posts/basic-dapper-resiliency-using-polly/60bd0ae2fffc4c13b9cd804c/comment/6348fb171b098b3c50f279fe)

Hi Joshua Steward,

While running the code I got one more error : "Unable to resolve service for type 'Polly.IAsyncPolicy' while attempting to activate 'SqlDapperClient'."

Can you please help me to resolve this issue.

Any help on this request is much appreciated.

Thanks, Santosh

[santosh kumar patro](https://hashnode.com/@santosh83)

[Oct 13, 2022](https://hashnode.com/posts/basic-dapper-resiliency-using-polly/60bd0ae2fffc4c13b9cd804c/comment/63483a4e1b098b3c50f26ad1)

Hi Joshua Steward,

I tried to create a POC following your code sample as reference and came across few build issues.

I also wanted to know what is the usage of SQLConnectionFactory here. On trying to resolve the references related to SQLConnectionFactory. It is under the namespace :System.Data.Entity.Infrastructure. It is asking me to install EntityFrameWork latest version via nuget package manager.

Hence I request you to share me the reference code in this case.

Thanks, Santosh

[santosh kumar patro](https://hashnode.com/@santosh83)

[Oct 12, 2022](https://hashnode.com/posts/basic-dapper-resiliency-using-polly/60bd0ae2fffc4c13b9cd804c/comment/63471cf084c4aa2c8e92f28b)

Thanks Joshua Steward for detailed article on Dapper with Retry policies. Can you please share the complete code repository for my reference. Also I would like to understand what are the best practices to implement DI for PRODUCTION environment scenarios.
