Here you will see the steps to learn about Web APi controllers & their behaviour using a Demo.
IntroductionThe Web API (Application Programming Interface) feature is based on a special kind of controller to an MVC framework application, it's normally as we do in MVC :). An API controller distinguishes itself from the normal controllers by the following:Action methods return a model rather than an ActionResult in MVC, objects.Action methods are selected based on the HTTP method used in the request. (We will elaborate on this a bit ahead as we go. :))The model objects that are returned from an API controller action method are encoded as JSON/XML based on the browsers used and then sent to the client.BackgroundWe work using the normal MVC4 framework, choosing an empty template. There is also a Web API template but we cannot get to understand the procedure using that. Let's get deeper into the following procedure in the Code section.Using the codeA Web API application is just a regular MVC framework app with the addition of a special kind of controller. Let's start with a small Demo for a better understanding. Let's go step-by-step.Creating the Model and Repository
Hands on ASP.NET GridView