AI Instructor Live Labs Included

ASP.NET Core Web API Development

Learn to build production-ready REST APIs with ASP.NET Core. From HTTP basics through authentication, testing, and deployment — build a complete API from scratch.

Intermediate
1d 12h 0m
26 Lessons
ASPNET-API
ASP.NET Core Web API Developer Badge

View badge details

About This Course

A comprehensive course on building production-ready REST APIs with ASP.NET Core. Covers HTTP fundamentals, controllers, routing, Entity Framework Core, dependency injection, validation, JWT authentication, authorization, testing, caching, rate limiting, and deployment. Students progressively build a TaskFlow API from scratch, then apply all patterns to a capstone project.

Course Curriculum

26 Lessons
01
AI Lesson
AI Lesson

Introduction to Web APIs and REST

45m
02
Lab Exercise
Lab Exercise

Introduction to Web APIs - Lab Exercises

2h 5m 4 Exercises
Explore the ASP.NET Core Project Structure Run the starter project, test the root endpoint, and explore the key files that make up an ASP.NET Core Web API application. ~15 min
Add OpenAPI/Swagger Support Install Swashbuckle, configure Swagger middleware, and explore your API through an interactive documentation UI. ~20 min
Build Your First API Endpoints Create GET and POST minimal API endpoints that return JSON, accept route parameters, and echo request bodies. ~25 min
Working with HTTP Methods and Status Codes Build a notes API with GET, POST, and DELETE endpoints that return proper HTTP status codes for each operation. ~20 min
03
AI Lesson
AI Lesson

Minimal APIs vs Controllers

45m
04
Lab Exercise
Lab Exercise

Minimal APIs and Controllers - Lab Exercises

1h 45m 3 Exercises
Create Your First Controller Create a TaskItem model and a TasksController with the ApiController attribute, then wire up controller routing in Program.cs. ~20 min
Implement Full CRUD Operations Add GET by ID, POST with CreatedAtAction, PUT, and DELETE actions to the TasksController with proper HTTP status codes. ~25 min
Compare Minimal APIs and Controllers Implement the same task list endpoint as both a minimal API and a controller, then compare the two approaches side by side. ~15 min
05
AI Lesson
AI Lesson

Routing, Parameters, and Model Binding

45m
06
Lab Exercise
Lab Exercise

Routing and Model Binding - Lab Exercises

1h 45m 3 Exercises
Add Query String Filtering Add filtering to GET /api/tasks using [FromQuery] parameters for status, priority, and search ~20 min
Implement PUT and DELETE Add PUT and DELETE endpoints with route constraints and proper status codes ~20 min
Advanced Parameter Binding Use [FromHeader] and [FromQuery] for request IDs and pagination ~20 min
07
AI Lesson
AI Lesson

Data Models, DTOs, and AutoMapper

45m
08
Lab Exercise
Lab Exercise

DTOs and AutoMapper - Lab Exercises

1h 50m 3 Exercises
Create Data Transfer Objects Create separate DTOs for create, update, and response operations ~20 min
Install and Configure AutoMapper Set up AutoMapper with mapping profiles for TaskItem and DTOs ~20 min
Refactor Controller to Use DTOs Replace TaskItem with DTOs in all controller actions using AutoMapper ~25 min
09
AI Lesson
AI Lesson

Entity Framework Core Integration

45m
10
Lab Exercise
Lab Exercise

Entity Framework Core - Lab Exercises

2h 20m 4 Exercises
Set Up EF Core with SQLite Install EF Core packages, create a DbContext, configure entity mappings, and create the initial database migration. ~25 min
Add the Category Entity Create a Category model, configure the one-to-many relationship with TaskItem, seed initial data, and apply a new migration. ~20 min
Refactor Controller to Use EF Core Replace the in-memory static list with async EF Core queries, use eager loading for related data, and update DTOs. ~30 min
Create a Categories Controller Build a full CRUD controller for categories with task count aggregation and test the complete API. ~20 min
11
AI Lesson
AI Lesson

Dependency Injection and the Service Layer

45m
12
Lab Exercise
Lab Exercise

Service Layer and DI - Lab Exercises

2h 0m 3 Exercises
Create the Repository Layer Define a repository interface and implement it with EF Core to encapsulate data access logic. ~25 min
Create the Service Layer Build a service layer that encapsulates business logic, uses the repository for data access, and AutoMapper for DTO transformations. ~25 min
Refactor the Controller Refactor the TasksController to use ITaskService instead of DbContext, achieving thin controllers with clean separation of concerns. ~25 min
13
AI Lesson
AI Lesson

Input Validation and Error Handling

45m
14
Lab Exercise
Lab Exercise

Validation and Error Handling - Lab Exercises

1h 50m 3 Exercises
Add Data Annotations Validation Add validation attributes to DTOs and observe how [ApiController] triggers automatic model validation. ~15 min
Implement FluentValidation Replace basic data annotations with FluentValidation for more powerful, testable validation rules. ~25 min
Build Global Exception Handling Create custom exceptions and middleware to return consistent ProblemDetails JSON for all error responses. ~25 min
15
AI Lesson
AI Lesson

Authentication with JWT Bearer Tokens

45m
16
Lab Exercise
Lab Exercise

JWT Authentication - Lab Exercises

2h 10m 4 Exercises
Configure JWT Authentication Install the JWT Bearer package and configure authentication middleware with token validation parameters. ~20 min
Create the Auth Controller Build a user model, auth service with JWT generation, and login endpoint. ~25 min
Protect Your API Endpoints Apply [Authorize] and [AllowAnonymous] attributes and test token-based access control. ~20 min
Associate Tasks with Users Add user ownership to tasks so each user only sees their own data. ~20 min
17
AI Lesson
AI Lesson

Authorization — Roles, Policies, and Claims

45m
18
Lab Exercise
Lab Exercise

Authorization - Lab Exercises

1h 45m 3 Exercises
Implement Role-Based Authorization Add role claims to JWT tokens and restrict the DELETE endpoint to Admin users only ~20 min
Create Authorization Policies Build custom authorization policies with requirements and handlers to enforce task ownership ~25 min
Build an Admin Dashboard Endpoint Create an admin-only endpoint that returns all users tasks with user information ~15 min
19
AI Lesson
AI Lesson

OpenAPI/Swagger, Logging, and Middleware

45m
20
Lab Exercise
Lab Exercise

Swagger, Logging, and Middleware - Lab Exercises

1h 50m 3 Exercises
Enrich Swagger Documentation Add XML comments, response type attributes, and JWT authentication to Swagger UI ~20 min
Create Custom Middleware Build request timing and correlation ID middleware components for the HTTP pipeline ~25 min
Configure Strongly-Typed Settings Use the Options pattern to bind configuration values and inject them into controllers ~20 min
21
AI Lesson
AI Lesson

Testing ASP.NET Core APIs

45m
22
Lab Exercise
Lab Exercise

Testing APIs - Lab Exercises

2h 5m 3 Exercises
Set Up the Test Project Create an xUnit test project, add project references, and install testing packages. ~20 min
Write Unit Tests for TaskService Write unit tests for the TaskService using Moq to mock dependencies and verify business logic. ~30 min
Write Integration Tests Write integration tests using WebApplicationFactory to test the full HTTP pipeline including authentication. ~30 min
23
AI Lesson
AI Lesson

Pagination, Caching, Rate Limiting, and CORS

45m
24
Lab Exercise
Lab Exercise

Advanced Features - Lab Exercises

2h 5m 4 Exercises
Implement Pagination Add pagination support to the tasks API with a reusable PagedResult class. ~25 min
Add Sorting and Filtering Add dynamic sorting with whitelisted property names and descending/ascending order support. ~20 min
Configure Rate Limiting Add fixed-window rate limiting with per-user partitioning to protect API endpoints. ~20 min
Configure CORS Configure Cross-Origin Resource Sharing to allow frontend applications to call the API. ~15 min
25
AI Lesson
AI Lesson

Capstone Briefing — Building a Production API

45m
26
Lab Exercise
Lab Exercise

Capstone Project — BookShelf API

2h 45m 2 Exercises
Build the BookShelf API Apply all course patterns to build a complete library management API from requirements alone. ~90 min
Test and Document Your API Write unit and integration tests, add XML documentation, and perform final verification. ~30 min

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 13 Hands-on Lessons
  • Completion Badge
ASP.NET Core Web API Developer Badge

Earn Your Badge

Complete all lessons to unlock the ASP.NET Core Web API Developer achievement badge.

Category
Skill Level Intermediate
Total Duration 1d 12h 0m
ASP.NET Core Web API Developer Badge
Achievement Badge

ASP.NET Core Web API Developer

Awarded for completing the ASP.NET Core Web API Development course. Demonstrates proficiency in building production-ready REST APIs including routing, Entity Framework Core, dependency injection, validation, JWT authentication, authorization, testing, caching, rate limiting, and API documentation.

Course ASP.NET Core Web API Development
Criteria Complete all 26 lessons in the ASP.NET Core Web API Development course, including all hands-on exercises and the BookShelf API capstone project. Pass all AI assessments with a minimum score of 4/6 per teaching lesson.

Skills You'll Earn

ASP.NET Core REST API Design Entity Framework Core Dependency Injection JWT Authentication Authorization FluentValidation API Testing OpenAPI/Swagger Rate Limiting CORS Middleware

Complete all lessons in this course to earn this badge