Request Injection in ASP.NET Core

I’ve created a Nuget package for this called RequestInjector if you are interested in using what is discussed in this post. Source code for the package can be found here.

These days, most people are familiar with dependency injection, and in the ASP.NET world, injecting into controllers. Less people probably are familiar with Jimmy Bogard’s Mediatr, and even fewer are probably familiar with directly injecting into the request objects. All of them are viable approaches to wiring up ASP.NET Core for dependency injection, but in my opinion, some approaches are better than others.
Continue reading “Request Injection in ASP.NET Core”