I wish wcf web api on the codeplex as a community project evolving itself. Both asp.net core and asp.net mvc are two web application frameworks where net mvc has already been discontinued. The stable release was done just one month.
Generally Speaking If Your Functionality Is Data Centric (For Example, Crud Operations) Then Web Api Serves Well Whereas If Your Functionality Is Ui/View Centric (Loading Html Fragments, Ajax Driven Pages) Then Mvc Controllers Are A Natural Choice.
This is not mandatory but it is a good convention to differ web api route from mvc route. But the mvc returns the data in the json format by using jsonresult. The stable release was done just one month.
Web Api Lacked A View Engine Like A Razor And Instead Was Designed To Be Used For Rest Apis.
In both frameworks, controllers are used to organize sets of action methods. The literal api at the beginning of the web api route pattern, makes it distinct from the standard mvc route. You have to write code in that class related to this view only.
It Has All The Same Syntax And Functionality.
Differences/advantages of one over the other But the mvc returns the data in the json format by using jsonresult. Web form based on functions and page behind code, i.e., there is code behind page for each view.
Asp.net Web Api Vs Asp.net Mvc 1.
It was a great alternative to wcf, soap, and older asmx style web services. I love wcf web api, it has a test client out of box. Web api supports the mvc features such as controllers, routing, filter, action results, ioc container, model binders, and dependency injection, among others.
It's Recommended That Api Controllers In Asp.net Core Inherit From Controllerbase And Add The [Apicontroller] Attribute.
Both asp.net core and asp.net mvc are two web application frameworks where net mvc has already been discontinued. Asp.net web api 2 was developed and shipped alongside asp.net mvc. Mvc focuses on separation of concern, i.e., there is no fixed code behind page for every view.