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 (How To)

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 7 steps
  • Adding Web API to Our Project

    6:12

  • Defining a Default API Route

    3:11

  • Adding an API Controller

    8:29

  • Using Postman

    3:40

  • Understanding Content Negotiation

    5:07

  • Exploring Parameter Binding

    8:57

  • 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 9 steps
  • Using Dependency Injection

    7:55

  • Calling Our Repository Methods

    3:23

  • Configuring the JSON Serializer

    9:49

  • Refining Our Responses

    7:54

  • Exercise: Adding the Activities and Intensities API Endpoints

    6:24

  • Adding Validation

    6:10

  • Using DTOs to Prevent Under-Posting

    9:07

  • Testing Our DTOs

    4:59

  • Section Review

    5 questions

Reviews

Start your review of Building Services with ASP.NET Web API Course (How To)

Never Stop Learning.

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

Someone learning on their laptop while sitting on the floor.