.NET Core Dependency Injection with constructor parameters
This post will be short and sweet, albeit one that caused me a bit of a headache. I recently worked on an ASP.NET Core project and I wanted to take advantage of the built-in Dependency Injection service to inject various services to the controllers. However, one of the services required a parameter in the constructor. This is not highly unusual so I was expecting to quickly find an example in the official docs, explaining how to do this. My search, however, returned no results. I then turned to Google/Bing but guess what? Nothing. Every example I found re-iterated …[read more]