.NET code examples

C# 14: New features with code examples

C# 14: New features with code examples

Download the code example and see what's new in C# 14. From extension members to simple lambdas, learn how these features make your code cleaner and smarter.
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.
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.
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.
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.
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.
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.
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.