Which is the best way of calling a web api action method from a mvc controller?
I know I could invoke the methods directly, as if there were ordinary services, but this approach would not call the configurated filters (among other things) that are configured with the web api controller/action.
Besides, as I want to do it in a generical approach, i would have to do it using reflection, and this way, I would have to implement the same logic used in webapi for action parameter matching, which could be very tricky to mimic.
I´ve seen this post: How can i call a WebApi method from MVC Controller Action Method?
Is this the correct answer? I wonder whether isn´t there a more cleaner way,like the RedirectToAction method would in a MVC--> MVC controller redirection.
Thanks