Optional DependencyInjection in .NET How to optionally inject a dependency using Microsoft DependencyInjection container Click here to read the article