ASP.NET Core APIs Fundamentals: Building Modern Web APIs with .NET 11

ASP.NET Core APIs Fundamentals: Building Modern Web APIs with .NET 11

13+

Build WarehouseApi with .NET 11: HTTP contracts, validation, EF Core, JWT authorization, versioning, tests, and containers.

0 followers
28 chapters
Software & AI Development
2026
You're viewing a limited preview. Create a free account to read free books or get Premium to unlock the entire library.

About This Book

ASP.NET Core APIs Fundamentals teaches you to build an HTTP API that other teams can depend on. You will build one Warehouse API from its first endpoint to a tested, containerized service that tracks inventory, reserves stock and fulfills orders. Each chapter changes the same project, so you see how routing, validation, data access, security, versioning and deployment decisions affect each other in code you can run.

Who This Book Is For

You can already write C# classes, interfaces, LINQ queries and async methods, and you know the basics of HTTP: methods, status codes and headers. You do not need previous ASP.NET Core experience. If you come from ASP.NET MVC, WPF or another .NET application type, the book shows what changes when your application's only user interface is its HTTP contract.

What You Will Build

Part I sets up the project, configuration and dependency injection, and maps your first Minimal APIs. Part II covers routing, binding, resource design, HTTP semantics, controllers, validation and middleware. Part III separates the application into services, stores data with Entity Framework Core 11 on SQL Server, and handles concurrency, transactions, telemetry and errors with Problem Details. Part IV secures the API with JWT bearer authentication and authorization policies, versions it with per-version OpenAPI documents and moves slow integration work into background processing. Part V adds integration tests, performance work and a container deployment.

Download the companion code free at unqbd.com/go/apis2-code. Each ChapterNN/WarehouseApi folder is the complete project at the end of that chapter, so you can start any chapter from the previous checkpoint. Each chapter's Activity folder holds the worked solution to its activity. Do each activity in a copy of your project, or in a new project: the next chapter continues from where this chapter's steps end, as the checkpoints do.

Release Baseline

The examples target net11.0 and use the .NET 11 SDK, version 11.0.100 or later, with Microsoft ASP.NET Core and Entity Framework Core packages at 11.0.0. Libraries outside the .NET release, such as Asp.Versioning and the Swagger UI viewer, have their own version numbers; the companion code pins the versions current at the time of writing. Read the release notes before you upgrade.

Under Microsoft's support policy, odd-numbered .NET releases such as .NET 11 receive Standard Term Support for two years. Check the current Microsoft .NET support policy when you choose a production baseline.

Local Prerequisites

The steps in this book use Visual Studio on Windows. Install the .NET 11 SDK, version 11.0.100 or later, and Visual Studio with the ASP.NET and web development workload: Visual Studio runs the .http request files, debugs the API, and opens a terminal for the dotnet commands with View > Terminal. Visual Studio Code is the complete alternative, on Windows, macOS or Linux: install the .NET 11 SDK, Visual Studio Code, and the C# Dev Kit and REST Client extensions. Each chapter gives the VS Code or terminal form of every Visual Studio step. From Chapter 10 on, the data chapters need SQL Server Express LocalDB 2022 on Windows, or a reachable SQL Server 2022-or-later instance. SQL Server containers require an Intel/AMD x64 Linux host; on Apple silicon, use a server on another machine rather than relying on emulation. Chapter 13 creates development tokens with dotnet user-jwts, which ships with the SDK. Chapter 16 builds a container image with Docker. No cloud account is needed to run the examples; the Azure deployment steps are shown so you can follow them with your own subscription.

Run a Checkpoint

In Visual Studio, open a chapter's WarehouseApi/WarehouseApi.csproj from the companion code with File > Open > Project/Solution, select http in the toolbar's start-button list, and choose Debug > Start Without Debugging (Ctrl+F5). In VS Code or a terminal, run dotnet --version in that WarehouseApi folder to confirm a .NET 11 SDK, then dotnet run --launch-profile http. The API listens on http://localhost:5080, and each project's .http file holds the chapter's requests. Later checkpoints need setup first: a database from Chapter 10 on, development tokens from Chapter 13 on, and an ERP key from Chapter 15 on. The companion README.md gives the commands for each and explains how to run the tests.

Enjoying this book?

Create a free account to leave comments, track your progress, and more!

Read and listen on the go with the unQbd app. Get the app
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.