Learn Minimal APIs from start to finish. Perfect for beginners.

.NET code examples

An ASP.NET Core app built with Claude AI
An ASP.NET Core app built with Claude AI

Get the technical documents and Claude project we used to build a real ASP.NET Core app from scratch using AI. Download and use them yourself.

Reusable PagedResults type for Entity Framework Core
Reusable PagedResults type for Entity Framework Core

Download a code example that includes a reusable PagedResults type and query extension, ideal for pagination in Entity Framework Core.

Automated SQL scripts using Entity Framework Core migrations
Automated SQL scripts using Entity Framework Core migrations

Learn how to add Entity Framework Core migrations in an Web API and worker project and use it to automate SQL scripts across all environments.

Clean architecture in a Web API endpoint
Clean architecture in a Web API endpoint

Learn how to refactor a Web API endpoint using clean architecture with validation, services, repositories and cleaner code structure.

Migrate controllers to Minimal APIs using API versioning
Migrate controllers to Minimal APIs using API versioning

Download the code that shows how controllers are migrated to Minimal API endpoints using API versioning in an ASP.NET Core Web API.

Create an email template in .NET
Create an email template in .NET

Download an ASP.NET Core code example that generates a HTML string using Razor Views that can used for an email template.

Using authentication in a Minimal API with Swagger
Using authentication in a Minimal API with Swagger

Download this Minimal API authentication example where API key security has been added through an authentication handler, and has been integrated with Swagger.

Validate .NET configuration on startup example
Validate .NET configuration on startup example

Download the code example to validate .NET configuration on startup using data annotations or FluentValidation, so your app fails fast and never ships with broken config.

Using transactions with Entity Framework Core
Using transactions with Entity Framework Core

See a code example of how transactions are used in Entity Framework Core and how they can be committed and rolled back

Using global query filters in Entity Framework Core
Using global query filters in Entity Framework Core

Download a .NET 10 sample project demonstrating Global Query Filters in Entity Framework Core, including soft delete and multitenancy, and run it in Visual Studio to see how they work in practice.