Developing APIs with ASP.NET Core

This course teaches developers how to build secure, database-backed Web APIs using ASP.NET Core, Entity Framework Core, and Razor Pages. Through a series of hands-on labs, learners will create a full-featured blog application that includes CRUD operations, JSON Web Token (JWT) authentication, and role-based access control. Participants will learn how to structure Web API controllers, connect to SQL Server using EF Core, secure endpoints with bearer tokens, and consume APIs from client-side Razor Pages, gaining the skills needed to build scalable and secure web applications.

  • Category: Software Development
  • Level: Intermediate
  • Time Estimate: 4h 15m
  • Price: $99.99 for 3 months of access
  • Subscription: $39.99 per month after 7-day free trial
  • Lab Environment: Included
  • Free Trial: 7 Days
Login to Purchase
Developing APIs with ASP.NET Core Badge
Lessons in this Course
Lesson
Lesson 1: Creating a new Web API

In Lesson 1, you’ll learn how to create and consume Web APIs using ASP.NET Core. Starting from a pre-configured solution, you’ll build a functional Web API that exposes blog data, then connect it to a client-side Razor Pages application using HttpClient. You’ll define a controller with RESTful endpoints, return hardcoded data, and test your API using Swagger. On the client side, you’ll configure dependency injection, retrieve API data asynchronously, and display it in a dynamic table. This lesson lays the groundwork for understanding the API-client relationship and how to structure clean, maintainable API-driven application

Duration: 1 h 15 m
Exercises
Exercise 1: Creating a new Web API and Data Model In this exercise, you will use an initial solution and create a new ASP.NET Core Web API and Web API Client. Estimated Time: 60 minutes
Lesson
Lesson 2: Persisting Blog Data in the Database

In Lesson 2, you’ll extend your blog application by integrating a real SQL Server database using Entity Framework Core. You'll replace in-memory data with persistent storage, enabling the API to perform full CRUD operations—create, read, update, and delete—against a BlogPosts table. You’ll learn how to use DbContext to manage database access, apply asynchronous EF Core methods for scalability, and wire up API endpoints to interact with live data. On the frontend, you’ll build Razor Pages for creating and editing blog posts through API calls, giving you hands-on experience with data modeling, API-backed forms, and real-time database updates in a modern .NET application.

Duration: 1 h 30 m
Exercises
Exercise 2: Persisting Data in the Database In this exercise, you will update your API controller to support CRUD operations to the database using Microsoft Entity Framework. Estimated Time: 45 minutes
Lesson
Lesson 3: Securing the Blog App and Blog API

In Lesson 3, you'll secure your blog application by implementing authentication and authorization using JSON Web Tokens (JWT). You'll learn how to generate JWTs upon user login, store them securely in HttpOnly cookies, and pass them in API requests for protected operations. The lab walks you through configuring the API to validate tokens, enforcing role-based access to sensitive endpoints like create, edit, and delete, and updating the Razor Pages client to honor user roles in the UI. By the end of this lesson, you'll understand how to protect your APIs and build secure, role-aware applications using ASP.NET Core authentication and authorization best practices.

Duration: 1 h 30 m
Exercises
Exercise 3: Securing Web and Web APIs In this exercise, you will implement authentication for the front-end web app and the backend API. Estimated Time: 60 minutes