From Zero to Hero: REST APIs in .NET

Build REST APIs the way billion-dollar companies do

About This Course

When people say, "I want to build an API", nowadays, they almost always mean a REST API. RESTful APIs have been the dominant way of building APIs nowadays and for a good reason. Their properties make them scalable and robust for the modern world of distributed computing, and even though they are far from the only way of building APIs, they are the most popular by a wide margin. In this course, Nick will teach you how to build REST APIs based on his experience building them for millions of users in billion-dollar companies.

Course Curriculum

4h 41m 10 sections
Welcome
01:21 Free preview
What will you learn in this course?
02:05 Free preview
Who is the course for and prerequisites
01:03 Free preview
What is REST?
01:07
The 6 constraints of REST
05:32
Resource naming and routing
02:09
HTTP Verbs are meaningful
02:05
Using response codes to indicate status
02:26
Flexible response body options
00:59
Understanding Idempotency
01:40
Using hypermedia for connectedness
01:44
The different types of errors
01:27
Section recap
00:53
The system we will build an API for
02:17
Creating the projects
02:27
Defining the movie API contracts
03:27
Creating a temporary database
06:23
Creating the movies controller
01:03
Implementing movie creation
04:26
Introducing mapping
02:04
Keeping track of the endpoints
02:17
Implementing movie retrieval
04:35
Perfecting the movie creation endpoint
01:37
Implementing movie update
02:52
Implementing movie deletion
01:32
Why partial updates are not used
01:24
Section recap
00:36
Implementing slug-based retrieval
06:04
Moving to a real database
01:39
Adding the database infrastructure code
06:35
Removing the old in-memory database
08:17
Adding a business logic layer
04:20
Implementing validation
09:37
Cancellation token passing
05:08
Section recap
00:39
Authentication and Authorization in REST APIs
02:20
What is the JSON Web Token?
03:58
The token generation service
01:31
Implementing JWT Authorization
07:07
Limiting actions for an admin
03:39
Limiting actions for a trusted member
02:36
Section recap
00:38
The concept of movie ratings
00:49
Where should ratings live?
02:27
Preparing the database
00:56
Using the user id
03:21
Updating the existing functionality to support ratings
05:35
Rating a movie
08:03
Deleting a rating
02:44
Retrieving user ratings
04:29
Section recap
00:43
Filtering
08:07
Sorting
06:35
Pagination
09:19
HATEOAS
05:12
Basic versioning
05:06
Advanced versioning
05:56
What is Swagger?
03:57
Integrating versioning in Swagger
03:37
Integrating auth in Swagger
02:00
Extending Swagger documentation
02:28
Adding health checks
04:54
Implementing Response caching
05:22
Implementing Output caching
06:11
Implementing API-key based auth
04:19
Implementing multiple auth
04:34
Section recap
00:57
Why create an SDK?
01:13
Creating the SDK project and the client example
02:03
Introducing Refit
02:40
Retrieving movies
02:00
Using the HttpClientFactory
01:44
Adding authentication
01:41
Handling token generation and refreshing
04:34
Adding the remaining requests
02:23
Section recap
00:39
What are Minimal APIs?
01:49
Creating the new endpoint structure
02:31
Migrating movie retrieval
03:17
Migrating movie creation
03:08
Migrating movie listing
03:09
Migrating movie update
01:11
Migrating movie deletion
01:54
Migrating rating endpoints
00:37
Migrating Auth
01:25
Updating Swagger
03:42
Updating versioning
03:36
Updating output cache
01:03
Section recap
00:34
Course conclusion
00:23

Meet Your Instructor

Nick Chapsas

Nick Chapsas

Nick Chapsas is a .NET & C# content creator, educator and a Microsoft MVP for Developer Technologies with years of experience in Software Engineering and Engineering Management.

He has worked for some of the biggest companies in the world, building systems that served millions of users and tens of thousands of requests per second.

Nick creates free content on YouTube and is the host of the Keep Coding Podcast.

View all courses by Nick Chapsas

What's New

Getting Started: Building .NET Applications on AWS
course

Getting Started: Building .NET Applications on AWS

Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

Learn More
What's new in C# 14
blog

What's new in C# 14

This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

Learn More
Let's Build It: AI Chatbot with RAG in .NET Using Your Data
course

Let's Build It: AI Chatbot with RAG in .NET Using Your Data

Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

Learn More
From Zero to Hero: SignalR in .NET
course

From Zero to Hero: SignalR in .NET

Enable enterprise-grade real-time communication for your web apps with SignalR.

Learn More
Deep Dive: Solution Architecture
course

Deep Dive: Solution Architecture

Master solution architecture and turn business needs into scalable, maintainable systems.

Learn More
Migrating: ASP.NET Web APIs to ASP.NET Core
course

Migrating: ASP.NET Web APIs to ASP.NET Core

A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

Learn More
Getting Started: Caching in .NET
course

Getting Started: Caching in .NET

Let's make the hardest thing in programming easy for .NET software engineers.

Learn More
From Zero to Hero: Testing with xUnit in C#
course

From Zero to Hero: Testing with xUnit in C#

Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

Learn More
Create a ChatGPT Console AI Chatbot in C#
blog

Create a ChatGPT Console AI Chatbot in C#

This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

Learn More