.NET Console Application Dependency Injection

Posted by Joe Enos on June 22, 2021 · 1 min read

When working with console applications, you need to manually define your service provider and scopes, but other than that, it functions as you are used to with ASP.NET.

Make sure you're choosing the proper lifecycle for your dependencies - Singleton, Transient, or Scoped.

View code on GitHub