Iโm trying to understand many new concepts for me, and I need some clarification on how to best create and transfer my highly typed model from my MVC controller to the Razor view using the web API.
As you can see from many examples, you usually create your model from some repository, and then pass it to the view (strongly typed or not), and then use the Razor syntax, which gives you access to your model to build html, not necessarily using JavaScript .
When it becomes difficult for me, when I want to use the web API to create the model that I want to use, as if I used it, as I described in the previous paragraph.
Should I call a new HTTPClient to call the web API service from my controller? Do I need to deserialize and format the response? etc...
I always see calls and manipulations from scripts in a view ...
Can someone point me in the right direction?
Thanks.
source share