In the last few interviews, I met the interviewer's question. I initially felt that these two were not comparable at all, and one of the interviewers said that there were differences, such as the base classes of inheritance, Webapi inherited things Apicontroller, and so on.
Today I will summarize, many of which are extracted from the Internet, the right as a memo.
- The problem is different: The Web API prefers the HTTP protocol-based service to directly return the user's data request. MVC is a framework for building a station, preferring to return a user's page request.
- Purpose: The Web API is mainly used to provide interface, mainly for the mobile phone side to provide interface
- ASP. NET MVC is a Web application that creates a return view (views) and data, and the ASP. NET Web API is a simple and easy-to-mature HTTP service that returns only data and does not return views.
Sum, summed up a piece, summed up ... The purpose of the solution is different, it can be derived from a variety of different, there is nothing good to say
Reference article:
77100222
Https://www.cnblogs.com/terry283618366/articles/5760297.html
The difference between MVC and Web APIs