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

Treehouse

Building Services with ASP.NET Web API Course

via Treehouse

Overview

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

Syllabus

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

    3:01

  • Overview of REST APIs

    4:55

  • REST APIs Review

    8 questions

  • Welcome to the Fitness Frog Client App

    5:23

  • Reviewing the Project Files

    3:31

  • Designing Our REST API

    6:55

  • Introducing Web API

    4:25

  • 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

    6:12

  • Adding Web API to a Project

    10 minutes

  • Defining a Default API Route

    3:11

  • Defining a Default API Route

    5 minutes

  • Adding an API Controller

    8:29

  • Adding an API Controller

    10 minutes

  • Using Postman

    3:40

  • Understanding Content Negotiation

    5:07

  • Exploring Parameter Binding

    8:57

  • 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

    7:55

  • Adding a DI Container

    10 minutes

  • Calling Our Repository Methods

    3:23

  • Calling the Repository Methods

    5 minutes

  • Configuring the JSON Serializer

    9:49

  • Configuring the JSON Serializer

    5 minutes

  • Refining Our Responses

    7:54

  • Refining Responses

    10 minutes

  • Exercise: Adding the Activities and Intensities API Endpoints

    6:24

  • Adding Validation

    6:10

  • Adding Validation

    5 minutes

  • Using DTOs to Prevent Under-Posting

    9:07

  • Testing Our DTOs

    4:59

  • Using DTOs

    15 minutes

  • Section Review

    5 questions

Related Courses

Reviews

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