No, the two use different base classes that serve different purposes. You can see the difference just by looking at the types,
MVC Controller and
ApiController.
Note If you have worked with ASP.NET MVC, then you are already familiar with controllers. They work similarly in Web API, but controllers in Web API derive from the ApiController class
instead of Controller class. The first major difference you will notice is that actions on Web API controllers do not return views, they return data.
Darrell Norton, MVP
Darrell Norton's Blog Please click "Mark as Answer" if this helped you.
DarrellNorto...
All-Star
86809 Points
9646 Posts
Moderator
MVP
Re: ApiController and MVC Controller
Apr 23, 2012 06:45 PM|LINK
No, the two use different base classes that serve different purposes. You can see the difference just by looking at the types, MVC Controller and ApiController.
Here's a great quote from this page:
Note If you have worked with ASP.NET MVC, then you are already familiar with controllers. They work similarly in Web API, but controllers in Web API derive from the ApiController class instead of Controller class. The first major difference you will notice is that actions on Web API controllers do not return views, they return data.
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.