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

.NET tutorials

Validating appsettings becomes much faster with .NET 8
Validating appsettings becomes much faster with .NET 8

.NET 8 allows for a faster way to validate the option values in appsettings.json in an ASP.NET Core Web API using data annotations.

Hosted service has a major update to its lifecycle events
Hosted service has a major update to its lifecycle events

The worker service project sees a major update in .NET 8 with the new IHostedLifecycle interface hooking into new background hosted service lifecycles.

Data annotations has some awesome additions in .NET 8
Data annotations has some awesome additions in .NET 8

Model validation for ASP.NET Core Web API now includes data annotations such as allowed and denied values as well as Base64 string validation.

TimeProvider makes it easier to mock time in .NET 8
TimeProvider makes it easier to mock time in .NET 8

The TimeProvider abstract class can be used in xUnit unit tests to mock the time and a timer using the FakeTimeProvider in .NET 8.

Collection expressions and the spread operator in C#
Collection expressions and the spread operator in C#

Learn how collection expressions and the spread operator work in C#, with examples of how to use them to simplify lists and arrays in .NET.

Blazor render modes explained: Server vs WebAssembly
Blazor render modes explained: Server vs WebAssembly

Learn the difference between Server and WebAssembly render modes in Blazor, how to set them globally or per component, and when to use each one in .NET.

Server-side rendering (SSR) for Blazor in .NET 8
Server-side rendering (SSR) for Blazor in .NET 8

Server-side rendering (SSR) is a render mode which has become a new Blazor feature for .NET 8, working in a similar way to ASP.NET Core MVC.

Primary constructors adds class parameters in C# 12
Primary constructors adds class parameters in C# 12

Primary constructors is a C# 12 feature that allows to add parameters to a class and includes dependency injection support.

Keyed services in .NET 8 finally sees a dependency injection update
Keyed services in .NET 8 finally sees a dependency injection update

.NET 8 brings keyed services, a dependency injection update for creating the same service with a different implementation in the IoC container.

FromQuery? FromForm? What do the .NET Web API attributes do?
FromQuery? FromForm? What do the .NET Web API attributes do?

How the FromQuery, FromBody, FromForm, FromHeader and FromServices attributes work in an ASP.NET Core Web API and MVC app with C# code.