Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.


Building Services with ASP.NET Web API Course

via Treehouse


Services expose data and processes through APIs (Application Programming Interfaces) implemented using common approaches or standards. Decoupling our back-end from our front-end makes it possible for our services to support multiple client apps. We can even allow other developers and organizations to consume and use our services to further broaden the reach of our applications.

In this course, you'll learn how to use the ASP.NET Web API framework to build a RESTful service or HTTP API. As you learn about Web API, you'll create a service for the Fitness Frog single-page web app (SPA) developed using Angular.

What you'll learn

  • Designing a REST API
  • Adding Web API to an Existing Project
  • Defining Routes
  • Adding API Controllers
  • Implementing Validation


Planning Our Service

We'll start with an introduction to services and an overview of REST APIs before we start designing the API for the Fitness Frog Client App, a single-page web app built using Angular. Then we'll take a closer look at the Web API framework including an exploration of its request/response pipeline.

Chevron 8 steps
  • Introduction to Services


  • Overview of REST APIs


  • REST APIs Review

    8 questions

  • Welcome to the Fitness Frog Client App


  • Reviewing the Project Files


  • Designing Our REST API


  • Introducing Web API


  • Section Review

    5 questions

Building Our Service

Let's add Web API to our project and add our first API controller! We'll see how to define a default route and explore how Web API's model binding maps incoming request data to our controller method parameters. We'll also see how content negotiation simplifies the serialization process while offering flexibility to our users.

Chevron 11 steps
  • Adding Web API to Our Project


  • Adding Web API to a Project

    10 minutes

  • Defining a Default API Route


  • Defining a Default API Route

    5 minutes

  • Adding an API Controller


  • Adding an API Controller

    10 minutes

  • Using Postman


  • Understanding Content Negotiation


  • Exploring Parameter Binding


  • Adding Action Method Parameters

    5 minutes

  • Section Review

    5 questions

Completing Our Service

Now we're ready to complete the service for the Fitness Frog Client App. Along the way we'll learn how to set up dependency injection, configure the JSON serializer, refine our responses, validate incoming data, and more!

Chevron 15 steps
  • Using Dependency Injection


  • Adding a DI Container

    10 minutes

  • Calling Our Repository Methods


  • Calling the Repository Methods

    5 minutes

  • Configuring the JSON Serializer


  • Configuring the JSON Serializer

    5 minutes

  • Refining Our Responses


  • Refining Responses

    10 minutes

  • Exercise: Adding the Activities and Intensities API Endpoints


  • Adding Validation


  • Adding Validation

    5 minutes

  • Using DTOs to Prevent Under-Posting


  • Testing Our DTOs


  • Using DTOs

    15 minutes

  • Section Review

    5 questions

Related Courses


Start your review of Building Services with ASP.NET Web API Course

Never Stop Learning!

Get personalized course recommendations, track subjects and courses with reminders, and more.

Sign up for free