I have a Blazor application that I am using. The dependency injection works well in the components/pages. But how can I access a dependency from one of my API Controllers?
Asked
Active
Viewed 67 times
0
-
Create a constructor. The parameters will be injected. – Brian Parker Jun 07 '22 at 23:20
-
Brian, can you post this as a possible answer, and I will accept it. It worked, thanks! – billsecond Jun 08 '22 at 00:05
1 Answers
1
As your controllers are already injected you only need add a constructor with parameters. The parameters will be injected assuming they are provided.

Brian Parker
- 11,946
- 2
- 31
- 41