.netasp.net-mvcrestmodel-view-controller

Difference between APIController and MVCController?


I'm studiyng API Rest and when I create a controller I have a lot of options. But I want to understand technically the difference between 'APIController with read/write options' and 'MVCController with read/write options'.

enter image description here


Solution

  • An API controller returns messages (or data), a MVC one returns views and data at once.

    See this for more information.

    The API controller is best used in a REST context, as in, it's used to build a REST service, independent from any front-end representation.

    The MVC controller is inherently designed for a MVC context, and as such returns views (and the required data) to be displayed by the web application.