.NET code examples

xUnit project example for unit testing in .NET and C#

xUnit project example for unit testing in .NET and C#

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.
Using Moq in an xUnit project to unit test a .NET project

Using Moq in an xUnit project to unit test a .NET project

Download an xUnit and a .NET class library project that uses the Moq mocking framework to mock objects as part of unit tests.
Get started with Entity Framework Core

Get started with Entity Framework Core

Get started with EF Core includes creating a DbContext, adding a migration, CRUD operations, the Include method, raw SQL queries and stored procedures.
ASP.NET Core Web API CRUD methods example

ASP.NET Core Web API CRUD methods example

Download an ASP.NET Core Web API code example which includes endpoints for each of the CRUD methods (Create, Read, Update and Delete).
Basic authentication in ASP.NET Core

Basic authentication in ASP.NET Core

Purchase a ASP.NET Core Basic authentication example allowing you to add the Authorization header to a HTTP request.
JWT authentication in ASP.NET Core

JWT authentication in ASP.NET Core

Download a ASP.NET Core JWT authentication example allowing you to generate a Bearer token to authenticate a HTTP request.
Roulette wheel in Blazor WebAssembly

Roulette wheel in Blazor WebAssembly

Create Roulette using Blazor WebAssembly. This .NET Blazor Wasm demo is built up with C# and Razor components.
Connect 4 game in Blazor WebAssembly

Connect 4 game in Blazor WebAssembly

Create Connect 4 using Blazor WebAssembly. This .NET Blazor Wasm demo is built up with C# and Razor components.
Tic-Tac-Toe game in Blazor WebAssembly

Tic-Tac-Toe game in Blazor WebAssembly

Create Tic-Tac-Toe (Noughts & Crosses) using Blazor WebAssembly. This Blazor Wasm demo is built up with C# and Razor components.
Data annotation .NET 8 additions in an Web API example

Data annotation .NET 8 additions in an Web API example

An ASP.NET Core Web API code example which includes the new data annotations for .NET 8 such as AllowedValues and Length.