Download an xUnit and a .NET class library project that uses the Moq mocking framework to mock objects as part of unit tests.
Download an xUnit test project to help you unit test your C# code in a .NET project. It includes Fact and Theory examples alongside different Assert methods.
Get started with EF Core includes creating a DbContext, adding a migration, CRUD operations, the Include method, raw SQL queries and stored procedures.
Download an ASP.NET Core Web API code example which includes endpoints for each of the CRUD methods (Create, Read, Update and Delete).
An ASP.NET Core Web API code example which includes the new data annotations for .NET 8 such as AllowedValues and Length.
A .NET 8 xUnit project which uses the TimeProvider and FakeTimeProvider class to mock time and a timer in unit tests.
Download the code example for injecting keyed services with dependency injection with an ASP.NET Core web app.
An ASP.NET Core code sample that features examples of FromQuery, FromHeader, FromForm, FromRoute, FromServices and FromBody in a Web API.
Download a ASP.NET Core JWT authentication example allowing you to generate a Bearer token to authenticate a HTTP request.
Download a Data Annotation custom validator written in C# that can be used in .NET with MVC and Web API for model validation.