ASP.NET Web API 2 Hands-On
4.3 (317 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
2,779 students enrolled
Wishlisted Wishlist

Please confirm that you want to add ASP.NET Web API 2 Hands-On to your Wishlist.

Add to Wishlist

ASP.NET Web API 2 Hands-On

Build your RESTful Web Service with ASP.NET Web API 2 from the ground up and learn how to use the new Attribute Routing.
4.3 (317 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
2,779 students enrolled
Created by Patrick God
Last updated 6/2016
English
English
Curiosity Sale
Current price: $10 Original price: $20 Discount: 50% off
30-Day Money-Back Guarantee
Includes:
  • 1.5 hours on-demand video
  • 2 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Build RESTful web services with Web API 2
  • Create custom URIs with Attribute Routing
  • Save data persistently in a database with Entity Framework Code First migrations
  • Use Attribute Routing to your advantage
  • Use JQuery to create, read, update and delete objects with Web API 2
View Curriculum
Requirements
  • Visual Studio 2015 Community Edition (free!)
  • Other versions of Visual Studio also work, but might be slightly different
  • You should have a little experience in building web applications in ASP.NET
  • You should have a little experience in C#
  • Experience with JQuery might help but is not absolutely necessary
  • Google Chrome or Mozilla Firefox are best suited to see the results of our web service
Description

In this course you will learn how to build a RESTful web service with ASP.NET Web API 2 and integrate it into an ASP.NET web application. You will use Visual Studio 2015 Community Edition, which is completely free. Whether you are new to web services or already have built a web service with the first release of Web API or any other framework doesn't matter, you will build your new service from the ground up. What you already should have is a little experience in C#. Having some knowledge in JQuery and building web applications in general might help, but is not absolutely necessary.

By the end of this course, you will be able to build a RESTful web service with Web API 2 by yourself, make GET, POST, PUT and DELETE HTTP Requests with JQuery and AJAX and use the new Attribute Routing of Web API 2 to control your REST web service design by creating custom URIs. You will also get a sneak peak at Entity Framework Code First migrations and learn how to save your data persistently in a database.

The only tools we will use in this course are Visual Studio 2015 Community Edition and Google Chrome. Both are available for download for free.

All source codes and exercise solutions of this course are also available for download, of course.

Who is the target audience?
  • This course is for students who want to use Web API 2 to build a RESTful web service for their web application
  • It doesn't matter whether you already have built RESTful web services or you have no idea about web services at all. You will learn to build a web service with Web API 2 from the ground up and integrate it into an ASP.NET web application.
Students Who Viewed This Course Also Viewed
Curriculum For This Course
16 Lectures
01:31:20
+
Introduction
1 Lecture 01:50

Welcome to the "ASP.NET Web API 2 Hands-On" course and thank you very much for signing up!

In this short introduction, you will see what you're going to learn in this course. Have fun!

Preview 01:50
+
Create the web service
2 Lectures 07:33

When you want to create a Web Service with Web API 2, you may find yourself in two different situations. You either want to build a new Web Application from scratch and use Web API 2 with that application, or you already have build a Web Application and add Web API 2 afterwards. In this lecture, we cover the first situation.

Preview 02:20

In this lecture, you will learn how to add Web API 2 to an already built Web Application in Visual Studio.

Preview 05:13
+
Your first HTTP request
5 Lectures 18:55

Web API uses the Model-View-Controller pattern. In this lecture, you will learn what this pattern actually means, and you will create your first model class in C#.

Preview 03:26

The controller implements the actual logic to a corresponding model. You learn to build your first controller in this lecture.

Preview 05:17

We want to use our new web service within a simple website. So we're going to add a new HTML page and install JQuery through the NuGet Package Manager to prepare our web application for the first web service call.

Preview 02:43

You will make your first GET HTTP Request with JQuery and Web API 2.

GET HTTP Request
03:51

What does actually happen when you're calling a RESTful web service and why does it work with Web API 2? You'll find the answer in this lecture.

Network & Routing
03:38
+
Completing CRUD
4 Lectures 31:31

In the last lectures, we received all available objects from the service. Now we only want to get a certain one. Here you will learn to write the server part.

Get Contact by ID - Server Side
04:04

In this lecture we're going to write the client part to get a single object from the service. Instead of $.getJSON(), this time we'll go into a little more detail by using $.ajax().

Get Contact by ID - Client Side
05:55

The first POST HTTP Request. We will create an object with JavaScript and add this object to the object array on the server.

POST HTTP Request
11:19

The last two of the four HTTP methods. We will change an object by using a PUT request and remove an object by using DELETE.

PUT & DELETE
10:13
+
URI customization & Entity Framework integration
4 Lectures 31:31

So far, we know how to make any kind of HTTP Request with Web API and JQuery. But we only get a particular object by using its ID. What about using another property, e.g. the name? We'll cover this task in this situation.

Get Contact by Name - Web API Routing & Action
07:08

Web API 2 delivers the so called Attribute Routing. This gives you more control over your API design. You're free to choose any URI for your routes, create a typical RESTful structure and don't have to rely on the routing tables of the first release of Web API anymore.

Attribute Routing
05:35

Attribute Routing is not only about defining custom URIs. In this lecture you will learn how to use prefixes and constraints with this new feature.

Route Prefixes & Constraints
04:52

You're ready to start creating web applications with Web API 2. Congratulations! The next step is to save your data persistently in a database. Entity Framework enables you to do this. In this lecture, you will learn the first steps of how to use Web API with Entity Framework and look for changes on your objects in the database.

Entity Framework Code First Migration
13:56
About the Instructor
Patrick God
4.4 Average rating
987 Reviews
11,838 Students
3 Courses
Passionate Software Developer, Teacher & Hiker

Writing code is what drives me. Creating software out of nothing is a skill I truly am passionate about and I want to share this astonishing feeling of making stuff with you.

I started to learn different programming languages as a teenager and always wanted to make software since the first time I played a game on a Commodore 64. During my bachelor and master studies I joined different companies, made desktop and web applications and video games professionally and was always striving to get better at my craft which I'm doing now for over 15 years.

For me the most important part about writing and teaching code is to have fun. If certain ways work for you and the results are maintainable and you have fun with your results, you're doing it the right way. I don't care if you always use your keyboard or switch to the mouse from time to time, so called best practices are not always best or practical, I want to teach you to develop software in a way it works in the industry, a way it works for you and in a way that makes you happy.