Closed
Description
So I enable it inside Startup.cs as so:
services.AddSingleton < IClientPackagesRepository, ClientPackagesRepository > () ;
I can do the injection on Controller level using
private readonly IClientPackagesRepository _repository;
public HomeController(IClientPackagesRepository repository)
I can do the injection as well on View level using
@inject IClientPackagesRepository repository;
What about if I want to do the injection right in Startup.cs?
I cannot figure out how to do it, and according to great Scott says in
https://weblogs.asp.net/scottgu/introducing-asp-net-5
I should be able.
I am thinking along the lines
app.UseServices...
Thanks for your help.
Metadata
Metadata
Assignees
Labels
No labels