Implementing an API in ASP.NET Web API

If you watched my Web API Design course, you should know what a pragmatic RESTful API looks like. In this course I'll show you how to implement it in ASP.NET Web API
Course info
Rating
(1540)
Level
Intermediate
Updated
Oct 1, 2013
Duration
6h 14m
Table of contents
Course Introduction
Implementing an API in ASP.NET Web API
API Basics
Securing APIs
Versioning
REST Constraints
Web API Version 2
Description
Course info
Rating
(1540)
Level
Intermediate
Updated
Oct 1, 2013
Duration
6h 14m
Description

Implementing a practical REST-based API can be a challenge. My previous course (http://pluralsight.com/courses/web-api-design) covered how to design a RESTful API while avoiding the dogmatic religion of REST but embracing the best of the pragmatic parts. In this course, I'll show you how to take that design and implement it in ASP.NET Web API including controllers, routing, dependency injection, versioning, security, hypermedia, REST constraints and caching.

About the author
About the author

Shawn Wildermuth has been tinkering with computers and software since he got a Vic-20 back in the early '80s. As a Microsoft MVP since 2002, he's also involved with Microsoft as an ASP.NET Insider and ClientDev Insider.

More from the author
Less: Getting Started
Intermediate
1h 11m
19 Sep 2018
More courses by Shawn Wildermuth
Section Introduction Transcripts
Section Introduction Transcripts

Course Introduction
Welcome to the Implementing an API in ASP. NET Web API course. My name is Shawn Wildermuth with Wilder Minds. In this course we're going to build a REST-ful API using these technologies. We're going to walk you through step-by-step and show you the actual code as we build it, and any cases we can. We're going to start out by showing you how to get ASP. NET Web API into a new or existing project. We're going to show you how Routing and Controllers work. We're going to use Dependency Injection with Web API. We're going to show you how to Map your Entities into Models so you can return Resources from your API. We're going to talk about managing Formatting of Results both in JSON and XML, but we are going to focus mostly in JSON. We're going to talk about securing Web API in a variety of ways, basic authentication, token authentication in OAuth. We're going to talk about several strategies for versioning your Web API Services. And finally, we're going to talk about implementing other REST Constraints, like including Caching, ETags, Hypermedia, as well as HATEOAS in general. We want the course to work by showing you the actual work that's involved. This will allow you to follow along if you like, or just view what we're doing so you can see that it's not overwhelming to get involved. You're going to see me build the code, and you're going to see the workflow in process that is required to create an API from scratch. And, hopefully, you'll be able to make sense of how these two work together, so, you can see how they all fit together in a cohesive project to expose in API. Ready to get started?

Implementing an API in ASP.NET Web API
Welcome to the first module of Implementing an API in ASP. NET Web API. My name is Shawn Wildermuth with Wilder Minds. In this module we're going to introduce you to Web API. We're going to start and talk briefly about creating web services with REST and how to be pragmatic about that. If you have viewed my other course on Web API design, this is a link to that course. We are going to be talking about some of those same central topics, and you'll get more out of this course if you've viewed my other course, but it is not a requirement. Next, we're going to be talking about why we would choose to build an API using ASP. NET Web API. We'll then show you how to get Web API into your project, or have you start a new project with Web API. We're going to build a controller. We're going to talk about serialization in Web API. A bit about dependency injection. Talk about Models versus Entities and how they relate to REST and Web API. And finally, introduce you to Routing and Parameter Mapping in Web API. Let's get started.

API Basics
Welcome to Module 2 of Implementing an API in ASP. NET Web API. In this module, we're going to talking about API Basics. My name is Shawn Wildermuth with Wilder Minds. In this module, we're going to start by talking about what we're actually building. Then we'll dive into Identifiers, implementing an Association, preparing for Security, implementing a POST operation, implementing a DELETE operation, implementing PUT and PATCH operations, implementing Paging, and finally implementing RPC-Style Calls. Let's get started.

Securing APIs
Welcome to Module 3 of Implementing an API in ASP. NET Web API. My name is Shawn Wildermuth with Wilder Minds. In this module we're going to be talking about securing the API itself. We're going to start by talking about APIs and Security, Cross-Origin Security, Authentication versus Authentication. In addition, we're going to discuss User Authentication versus App Authentication, using ASP. NET Authentication in Web API. We're going to show you how to build Basic Authentication, Token Authentication. We're going to walk through an example of OAuth. Let's get started.

Versioning
Welcome to Module 4 of Implementing an API in ASP. NET Web API. In this module we're going to be talking about versioning. We're going to start by explaining what API Versioning is. We're going to go ahead and create a Versioned Controller. We're going to show you how to use Versioning with URLs via the Routing. We're then going to explain what the Controller Selector is, and how you would use it to do Versioning with the Query String, with a Version Header, and finally with MediaTypes. Let's get started.

REST Constraints
Welcome to Module 5 of Implementing an API in ASP. NET Web API. My name is Shawn Wildermuth of Wilder Minds. In this module we're going to be talking about the different constraints of REST, and how you implement some of them, how we have already implemented some of them, and which ones you should choose to implement based on your API needs. We're going to start by talking about the constraints of REST and what that actually means. These constraints consist of Client-Server, Stateless Server, Cache, Uniform Interface, a Layered System, and Code On-Demand. Let's get started.

Web API Version 2
Welcome to the sixth module of Implementing an API using ASP. NET Web API. My name is Shawn Wildermuth of Wilder Minds. In this module we want to explore the new APIs that have been exposed in the second version of Web API. We're going to cover what is Web API 2. We're going to look at how to upgrade a project from Web API 1 to 2, and we're going to have a deep discussion of attributed routing, or the ability to use attributes to define your routes instead of typical routing. We're going to look at Cross Origin Resource Sharing and how that's enabled in version 2. And then finally, we're going to wrap it up with a new facility in Web API 2 called IHttpActionResult. Let's get started.