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

.NET tutorials

xUnit Assert basics: True/False, Equal, Same, Matches and more
xUnit Assert basics: True/False, Equal, Same, Matches and more

Learn xUnit basic assert methods like boolean checks, range validations, and string assertions to write clear, reliable, and maintainable unit tests.

How to use InlineData, MemberData and ClassData in xUnit
How to use InlineData, MemberData and ClassData in xUnit

Master xUnit Theory attributes like InlineData, MemberData, and ClassData to build powerful, parameterised unit tests with ease.

How to add unit testing to Minimal APIs routes using xUnit
How to add unit testing to Minimal APIs routes using xUnit

Learn how to unit test minimal API endpoint handlers in ASP.NET Core using xUnit by organising routes and handlers into separate classes.

Add API key authentication to an Minimal API endpoint
Add API key authentication to an Minimal API endpoint

Learn how to add API key authentication to minimal API endpoints using a saved key in the config and apply a fallback policy to secure all routes.

Minimal API filters: Run code before the endpoint handler
Minimal API filters: Run code before the endpoint handler

Learn how to add multiple endpoint filters to minimal API routes to run custom logic before and after your endpoint handlers.

TypedResults or Results for Minimal API responses?
TypedResults or Results for Minimal API responses?

Learn when to use TypedResults vs Results in minimal APIs and explore the different response types available for returning API responses.

How to use parameter binding for routes in Minimal APIs
How to use parameter binding for routes in Minimal APIs

Learn how to use parameter binding in minimal API routes with wildcards and constraints, and how to use them in endpoint handlers with special types.

How to use routing in Minimal APIs with one line of code
How to use routing in Minimal APIs with one line of code

Learn how to create minimal API routes in one line, add endpoints to OpenAPI documentation, and group related routes for better organisation.

Common ASP.NET Core dependency injection errors and how to fix them
Common ASP.NET Core dependency injection errors and how to fix them

Learn the most common dependency injection errors in ASP.NET Core, including scoped from singleton issues, unregistered services and incorrect service lifetimes.

How to write xUnit tests for dependency injection services
How to write xUnit tests for dependency injection services

Learn how to write xUnit tests for a class that injects services that uses ASP.NET Core dependency injection using mock and real instances.