WebApi

Polly and Blazor, Part 3 - Dependency Injection

Using Polly with Blazor is simple, as I've shown in the previous two posts. In this I will define the Wait and Retry Policy in the `Startup`, add it to the service collection and use dependency injection to pass it into the Razor page.

Polly and Blazor, Part 2 – Using the Context

When using Blazor and Polly there are a few ways to pass data from Polly back to the UI, this example shows how to do this with the Polly Context.

Polly and Blazor, Part 1 - Simple Wait and Retry

A few weeks ago I gave a talk on Polly at Dotnetconf (you can [check it out here](https://www.youtube.com/watch?v=L9_fGJOqzbM)), at the end I got many questions about using Polly with Blazor, I had never tried it, but assumed it would work. In this blog, part 1 of a few on Polly and Blazor, I'll show you how to get a simple retry mechanism up and working in a Blazor Server App. For now, I am not concerned with dependency injections, policy registries or anything other fancy things in this post, that will come later.

Registering Multiple Implementations of an Interface in ASP.NET Core with Autofac

Full source code here. A few weeks ago I wrote a post about using dependency injection to pick between two implementations of an interface. It was a solution I was not very happy with because it meant I had to new up the implementations inside a factory or I had to use service collection to instantiate all implementations of the interface and then use a piece of code to return the one the was wanted.

Simmy Chaos Engine for .NET – Part 4, Doing Some Real Damage, Dropping a Table

Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. Up until now the Simmy examples I’ve written have thrown exceptions, changed successes to failures or slowed down a request.

Registering Multiple Implementations of an Interface with Service Collection in ASP.NET Core

Full source code here. _This is a simplistic approach to the problem and assumes that the dependencies created by the factory do not in turn have their own dependencies. This deficiency could be mediated by passing those dependencies into the factory.

Accessing the HttpContext from the Constructor of a Controller or a Dependency

Full source code here. There are times when you may need to access the HttpRequest from places that it is not normally available such as the constructor of a controller or the constructor of a service that is built by dependency injection.

Simmy Chaos Engine for .NET – Part 3, Adding Latency

Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. This is the third in my series on chaos engineering with Simmy. The first two posts dealt with the fault policy throwing exceptions and returning failed responses rather than calling the remote service.

Simmy Chaos Engine for .NET – Part 2, Resilience and Injected Faults

Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. I wrote a blog on using a Simmy Fault policy a few days ago, it is very simple to use by itself, but it is far more useful when used in combination with a resilience policy.

Simmy Chaos Engine for .NET - Part 1, Injecting Faults

Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. For quite a while I have been writing, presenting and making videos about using Polly to make applications more stable.