A Practical Guide to ASP.NET Web API

By | February 17, 2014

Microsoft ASP.NET Web API framework is the best choice for developing HTTP services in more simpler way. It enables us to reach more wider ranger of clients such as browsers as well as mobile devices.In one of my previous web development tutorial about building RESTful service, I explained that the purpose of HTTP is not just acting as a transport layer (for example, in case of SOAP-based WCF service). However, its a very mature platform for developing Web APIs and utilizing its old simple concepts such as HTTP methods, HTTP status codes and URIs etc.

Note: You can download a PDF version of the same “A Practical Guide to ASP.NET Web API” here.

So, we can say that using ASP.NET Web API, we can create HTTP services

  • those are non-SOAP based like plain XML or JSON string.
  • using full features of HTTP.
  • reaching broader range of clients (browsers and mobile devices).

You can find recent ASP.NET Web API Tutorial for Creating your First SPA Application using AngularJS and Web API having all CRUD Operations.

Following is the typical ASP.NET Web API processing architecture.

ASP.NET Web API Service
You are designing an ASP.NET Web API application. You need to select an HTTP verb to allow blog administrators to moderate a comment. Which HTTP verb should you use?

  • A. GET
  • B. POST
  • D. PUT

To further test your ASP.NET Web API skill, Take a Complete FREE Online Test or MCSD Practice Exam: 70-486 (Developing ASP.NET MVC Web Applications). Simply Click Here.

 Correct Answer: D

Lets move forward to implement all the above mentioned related features step by step.

Chapter 1:- Developing your first ASP.NET Web API service
In chapter 1, we will be creating a simple HTTP service using Web API. A step by step approach is used while developing the service and getting results as:

  • Creating a Web API Project in Visual Studio
  • Preparing a Domain Model
  • Adding Controller
  • Finally testing results in browser.

Chapter 2:- Performing CRUD operations using ASP.NET Web API service – Part 1
As chapter 1 only focuses getting records using HTTP GET verb only, this chapter provides complete detail understanding of all CRUD (Create, Retrieve, Update, Delete) operations using Web API. Discussion about all related HTTP verbs i.e. GET, PUT, POST, DELETE is provided.

Chapter 3:- Performing CRUD operations using ASP.NET Web API service – Part 2
As we have already developed Web API service in previous chapter, here in this chapter, we will be consuming already created HTTP service using jQuery. Complete code snippet of jQuery for consuming a Web API service is given with detailed understanding of jQuery AJAX call.

Chapter 4:- What’s new in ASP.NET Web API 2
Web API version 2 is released and this chapter briefly overview the top new features of ASP.NET Web API i.e.

  • Attribute Routing
  • Cross Origin Resource Sharing
  • Open Web Interface for .NET
  • IHttpActionResult
  • Web API OData
Chapter 5:- Model Validation in ASP.NET
Model in MVC framework is a representation of data structure. This Web API Tutorial focuses to understand and implement the data annotation technique for applying validation on a model class for an ASP.NET Web API application.

Chapter 6:- Exception Handling in ASP.NET Web API – Part 1
This chapter discusses about Exception Handling in ASP.NET Web API service. Instead of returning a generic status code i.e. 500 (Internal Server Error), a valid and meaning result should be sent back to client using HttpResponseException type.

Chapter 7:- Exception Handling in ASP.NET Web API – Part 2
To achieve the same purpose, as discussed in previous chapter, for more advanced scenarios: Web API provide Exception Fitlers and focus of the chapter is how to create an Exception Filter and return meaningful response.

Chapter 8:- ASP.NET Web API OData 5.3
Discussing in detail about features of Microsoft ASP.NET Web API OData 5.3 and 5.3.1 beta including:

  • Open Entity Type Support
  • Major Bug Fixes
  • Dynamic Collection Property in Open Type
  • More about flexibility to use $levels and $expand queries
  • Utilizing OData Core Libraries.

Extras:- Top 10 ASP.NET Web API Interview Questions
For a detailed and comprehensive list of Top 10 most important Interview Questions for Microsoft ASP.NET Web API that every Web Developer MUST Know.

Top 10 Interview Questions and Answers Series:

ASP.NET Jobs [Updated Daily]


C# Developer
Source: Posh Technologies
Details: 5+ years of working experience with C#, ASP.Net MVC, SQL Server, JavaScript. 10+ years of Software development experience with strong background in computer...  More
9 days ago

Redmond, WA 22-May-2016

C# Developer
Source: Diverse Lynx
Details: ASP.NET MVC, AngularJS. We need a strong developer having following skills:....  More
11 days ago

Redmond, WA 20-May-2016

ASP.NET MVC Front-End Developer
Source: Webtellect, LLC
Details: 3+ years of ASP.NET MVC development. Proven past experience of the ASP.NET MVC stack. The team member needs to be adept and skilled in HTML, CSS, and Javascript...  More
22 days ago

Redmond, WA 09-May-2016

Sr. Applications Developer
Source: Ruan
Details: Experience using the Microsoft stack with extensive knowledge in C#, SQL Server and ASP.NET MVC. Sr....  More
27 days ago

Des Moines, IA 03-May-2016

ASP.NET MVC Developer
Source: Noblis
Details: Twitter Bootstrap JavaScript MVC Framework e.g. AngularJS, KnockoutJS Web API SharePoint (Content Management) Oracle (PL-SQL) Azure Cloud APIs Mobile...  More
30+ days ago

Falls Church, VA 22042 20-April-2016

Senior .Net Developer
Source: Indeed
Details: (ASP.Net MVC, C#, Entity Framework, SQL Server 2012 etc.). Bachelor’s Degree required, Master’s Degree strongly preferred....  More
4 hours ago

Dallas, TX 31-May-2016

.NET Developer
Source: Graphic Products
Details: ASP.Net MVC Framework. Graphic Products is seeking a .NET Web Developer to join our IT department....  More
4 days ago

Beaverton, OR 97008 26-May-2016

Junior C#/ASP.Net/MVC Developer - 3 months+ (Fairfield, NJ)
Source: Indeed
Details: Experience with MVC, Xamarin, Telerik, SSIS is a plus. Junior C#/ASP.Net Developer - 3 months+ Contract*....  More
30+ days ago

Fairfield, NJ 28-April-2016

.NET Web Developer
Source: Indeed
Details: ASP.Net MVC Framework. Graphic Products is seeking a .NET Web Developer to join our IT department....  More
5 days ago

Beaverton, OR 97008 26-May-2016

Web Developer-ASP.NET/ MVC/SQL Server Developer
Source: Cigna
Details: Experience with MVC design patterns is required. Strong understanding of web design as it relates to MVC design patterns, attuned to the fundamentals of user...  More
19 days ago

Bloomfield, CT 12-May-2016

Senior .Net Web Developer
Source: Indeed
Details: *SENIOR .NET WEB DEVELOPER* *Job Description* We are looking for an experienced web developer to join the development team. The Senior Web Developer will be  More
5 days ago

Basking Ridge, NJ 26-May-2016

Software Developer
Source: Indeed
Details: .NET platform – including C#, ASP.NET, MVC, Web API, and Entity Framework. This is made up of a number of systems ranging from front-end websites to backend...  More
26 days ago

Seattle, WA 05-May-2016

Source: Indeed
Details: C#, ASP.NET, MVC, Web API, XML, JSON, MySQL, HTML5, CSS3, JavaScript, jQuery, AJAX, Bootstrap:. Experience developing enterprise-class web-based software using...  More
30+ days ago

Solon, OH 27-April-2016

Full Stack Developer (FT); Trevose/Bensalem, PA area
Source: Indeed
Details: Expertise in MS technologies, including .NET 4.0/4.5, C#, ASP.Net MVC, WebApi, IIS, SQL Server, etc.:. Expert knowledge of Microsoft technologies, including...  More
6 days ago

Feasterville-Trevose, PA 19053 24-May-2016

c# .net Developer
Source: Diverse Lynx
Details: ASP.NET MVC, AngularJS. Strong developer having following skills:....  More
19 days ago

Redmond, WA 12-May-2016

.NET Developer
Source: Indeed
Details: Visual Studio 2013+ • .NET 4.5+ • ASP.NET MVC 4+ • Web App (GUI building experience) • HTML5 • C# • NuGet • log4net • TFS SQL Server 2014+ • SQL (not necessary...  More
7 days ago

Chicago, IL 24-May-2016

Senior .Net Developer / Architect
Source: Indeed
Details: Expert in Microsoft tools and technologies, particularly .NET/C#, MVC. .NET SQL C# Software Development Agile Methodologies SDLC T-SQL ASP.NET Applications...  More
7 days ago

Nashville, TN 23-May-2016

.Net Developer
Source: Indeed
Details: IT, Information Technology, .Net web developer, .Net Developer, Software, Software Engineer, .Net, full development stack, HTML, HTML 5, CSS, JavaScript, Java,...  More
30+ days ago

Reston, VA 02-March-2016

Junior software developer
Source: Indeed
Details: Preferred Experience with ASP .NET MVC. ASP.NET MVC, Microsoft SQL Server, Bootstrap:. Open career opportunity for an entry level programmer....  More
10 days ago

Flowood, MS 21-May-2016

.NET Developer
Source: CGI
Details: •Solid understanding of UI Framework especially with MVC. •Experience with Razor View Engine and ASP.net MVC framework....  More
30+ days ago

Columbus, OH 43240 26-April-2016

.NET Developer
Source: Indeed
Details: MVC,. Experienced in developing ASP.NET MVC 3+ Web applications,. NY, Edgewood, Long Island....  More
11 days ago

Long Island, NY 19-May-2016

C# / ASP.NET Developer (FTE) (Dallas)
Source: Brand Protection Agency, LLC
Details: The developer will be exposed to the latest technologies such as WCF, ASP.NET, ASP.NET MVC, .NET 3.5 and 4.0, JavaScript, AJAX, JSON, ext-js and other open...  More
23 hours ago

Dallas, TX 30-May-2016

Front End/UI Developer
Source: Indeed
Details: 3+ years web development experience- ASP.NET MVC, Ruby, or similar. .net, mvc, web application, javascript, html, css, sql, linq, jquery, ajax, c#, asp.net,...  More
14 days ago

Arlington, VA 17-May-2016

Senior Developer/Designer with.NET and Azure Experience, Houston TX
Source: CSC
Details: Requirements Must have strong C# skills with hands-on experiences with object oriented programming Understanding of SOA including Web API ASP.NET MVC OData...  More
2 days ago

Houston, TX 77056 29-May-2016

.Net Developer
Source: Indeed
Details: Position: .net developer Location: Georgetown DC Duration: 6 month contract to hire 120,000 conversion salary Top Three skill sets: * ASP.net/MVC * AngularJs   More
28 days ago

Alexandria, VA 03-May-2016
Category: ASP.NET ASP.NET Web API Tags:


Imran Abdul Ghani is working as Software Developer(Senior) with extensive knowledge in Web development technologies especially C#, ASP.NET, MVC, WCF, Web API, ADO.NET Entity Framework, jQuery etc. He has several years of experience in designing/developing enterprise level applications. He is Microsoft Certified Solution Developer for .NET (MCSD.NET) since 2005. You can reach his blogging at www.webdevelopmenthelp.net, www.topwcftutorials.net, and www.sharepointfordummies.net.