0
After the Publish of a Web API project I added in the dll references of this API in another Solution, the intention is to "consume" this API without httpclient, to access the controller methods of this API.
That’s possible?
I tried but when I call the namespace apiService.Controller.Testecontroller() is required the interface that is in the controller injection, and I do not have access to it by the DLL, so it comes hot if it is possible what I am trying to do, if yes where I am missing?
It’s even possible, but it’s kind of a weird thing to do. Anyway, how do you want to create an instance of
TesteController
without passing the constructor parameters? You see, if there’s something being "injected" into the constructor, it’s because the controller uses it, if the controller uses it and you don’t pass it to it, how it would work?– Jéf Bueno
It is, but in the API project has an injection container that solves this, after compiled it should not be all working?
– rhgm
That’s not how it works. I suggest you stop and study a little bit about how this dependency injection works.
– Jéf Bueno
I abandoned the idea, I saw that it is very gambiarra that I am thinking of doing, thanks for the help.
– rhgm