Building a Simple REST Controller with Microsoft Visual Studio 2012 and WebAPI

Three Part Series

(Part 1)

 

Building a Simple REST Controller with Microsoft Visual Studio 2012 and WebAPI
Using Sencha ExtJS 4.2 and Sencha Architect 2.2, Build a Simple REST client (to feed WebAPI server)
Add CRUD to REST client for calling Microsoft WebAPI server

 

REST can be a very loaded term that brings up lots of discussions of what it means.  Just to mention a few sites that define it take a look at this list:

What is abundantly clear is there is not one clear concise explanation.  That said, I’m going to try and explain how to implement a Microsoft WebAPI REST controller that is written with Microsoft Visual Studio 2012.

First, you need to create the WebAPI controller.  I created a separate directory called “api” in my VS project for this purpose.  The dialog comes up as follows: (I chose “API controller with empty read/write actions” and renamed it to be TagsRest Controller.  My default url will now be http://mywebsite.com/api/TagsRest.

 

image

By default, the following controller class is made for me.

 

image

 

Surprising, I’m going to end the post here because we are really done.  There are empty methods, which is OK because I did not mean to define an implementation with this post, just show how to create a WebAPI REST controller which I’ve done.

In the next post, I’ll show how to create a simple Sencha ExtJS application that consumes this REST service.

About Peter Kellner

Peter is a software professional specializing in mobile and web technologies. He has also been a Microsoft MVP for the past 7 years. To read more about Peter Kellner and his experience click here. For information about how Peter Kellner might be able to help you with your project click here.

Follow me:


Trackbacks

  1. […] *For those who are intersted in this, I just posted a 3 part series on using ExtJS 4.2 with Microsoft’s new WebAPI Restful Interface.  The new WebAPI is more efficient on the server side and the coding to REST makes the ExtJS side simpler. (March 13, 2013)    Part 1 […]

  2. […] *For those who are intersted in this, I just posted a 3 part series on using ExtJS 4.2 with Microsoft’s new WebAPI Restful Interface.  The new WebAPI is more efficient on the server side and the coding to REST makes the ExtJS side simpler. (March 13, 2013)    Part 1 […]

  3. […] Building a Simple REST Controller with Microsoft Visual Studio 2012 and WebAPI […]

Your Comments

*

Protected with IP Blacklist CloudIP Blacklist Cloud

Follow

Get every new post delivered to your Inbox

Join other followers: