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

.NET code examples

Read and write to a CSV file example in ASP.NET Core
Read and write to a CSV file example in ASP.NET Core

Download a code example to read from and write to a CSV file using a list in ASP.NET Core with examples on how to handle headers and different header titles.

Request logging in ASP.NET Core example to save logs to a DB
Request logging in ASP.NET Core example to save logs to a DB

Download a request logging in ASP.NET Core example that uses middleware to save logs to the database with Entity Framework Core and SQL Server.

xUnit v3 examples: Assert.Skip, TestContext & TheoryDataRow
xUnit v3 examples: Assert.Skip, TestContext & TheoryDataRow

Download a code example from xUnit v3 that includes features such as Assert.Skip, Assert.SkipWhen, Assert.SkipUnless, TestContext and TheoryDataRow.

Exploring xUnit: Theory, Assert methods and Fixtures
Exploring xUnit: Theory, Assert methods and Fixtures

Download xUnit code examples so you can run unit tests with different Theory attributes, different assert methods and learn how to run tests with fixtures.

Minimal API code example for ASP.NET Core
Minimal API code example for ASP.NET Core

Download an Minimal API code example that allows you to test routes, parameters, results, filters, authentication and unit testing.

Dependency injection code example for ASP.NET Core
Dependency injection code example for ASP.NET Core

Download an ASP.NET Core dependency injection that allows you to register and test how the singleton, scoped and transient service lifetimes work.

Run an ASP.NET Core application in a Docker container
Run an ASP.NET Core application in a Docker container

Download a code example which includes a Dockerfile to build and publish an ASP.NET Core Web API into a Docker container and run the application.

.NET 9 code example to download with its key new features
.NET 9 code example to download with its key new features

Download an ASP.NET Core application in .NET 9 and try out its key new features such as HybridCache, OpenAPI support and new LINQ methods.

C# 13 - Code examples that include all the new features
C# 13 - Code examples that include all the new features

Download C# 13 code examples which includes all the new features so you can try them out for yourself and see what has changed from previous C# versions.

SignalR hub example sending chat messages in ASP.NET Core
SignalR hub example sending chat messages in ASP.NET Core

Download a .NET SignalR example which adds a hub that sends messages to clients when one is connected and when a method is invoked.