Type-Level Dependency Injection

Let’s have fun with some of C#’s recent features. Imagine you’re working on a recipe app. Users can type in what ingredients they have to hand and the app will suggest some recipe ideas from its library. As usual, each service in the app gets an interface : interface ILogger { void Log ( string message ); } interface IRecipeRepository { IEnumerable < Recipe > FindRecipesWithIngredient ( string…