For example, there is some Asp.Net Web Api application and you need to write an ASP.NET MVC application that would pull the API and display information to the user on the site.

I found an example on Metanit.com and there the work with the WEB API carried out through requests that are jerked directly from JavaScript , and then the response JSON is drawn in the interface. Only in this style you can work with the WEB API or are there any other options?

For example, in WCF, you can create a client right in the controller, do something and spit everything out into the view.

  • Although ... like, I found an example of tutorialsteacher.com/webapi/… . Here through the webclient there is an appeal to the API, then it is deserialized and bullets into a view. Is it right to work like that? - iluxa1810
  • Web API he whose - yours or someone else? If a stranger, then yes, access it using WebClient / HttpClient / WebRequest. - Alexander Petrov
  • And if my ....? - iluxa1810
  • ASP.NET WebAPI and MVC projects are the same. They differ only in the fact that api returns data in the form of json (or xml, csv ...), and mvc sends this data to vyyuhu, where they are converted to html. That is, you need to add the necessary View to each controller and that's it. Well, somehow the way to settle. - Alexander Petrov
  • one
    @ iluxa1810 didn’t quite understand your question, but firstly they are already doing everything on the .net core, secondly in the modern Full-st development for the front they use Angular or React which are responsible for the front logic and markup and back part te server spits out the data in Json This works much faster than the tk markup will weigh a lot and slow down your application, while you need to pass a user condition to the front, you will send an entire html page, this has not been practiced for a long time (in normal offices) - Bulat

0