- Home
- .NET code examples
.NET code examples
![Connect 4 game in Blazor WebAssembly](/media/kwvhkiqt/cover-1.png?width=350&height=197&v=1d9c4aa62717f30)
![Tic-Tac-Toe game in Blazor WebAssembly](/media/eddbjm1v/background-3.png?width=350&height=197&v=1d9c479d9b8e3c0)
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](/media/z5lhmlwh/tutorial-profile.png?width=350&height=197&v=1da9ed829d3ec90)
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.![TimeProvider example for mocking time and timer in xUnit](/media/5dkc1fmr/cover.png?width=350&height=197&v=1da250e9bac2150)
TimeProvider example for mocking time and timer in xUnit
A .NET 8 xUnit project which uses the TimeProvider and FakeTimeProvider class to mock time and a timer in unit tests.![Keyed services for ASP.NET Core dependency injection example](/media/q0df25ch/cover.png?width=350&height=197&v=1d9e825b08d6230)
Keyed services for ASP.NET Core dependency injection example
Download the code example for injecting keyed services with dependency injection with an ASP.NET Core web app.![Azure DevOps pipeline example .NET project for CI/CD](/media/3dmbdvk5/cover-2.png?width=350&height=197&v=1d9c645fec2e990)
Azure DevOps pipeline example .NET project for CI/CD
A .NET project for use in the CI/CD setup of a Azure DevOps pipeline. This demo can be used for a build and release pipeline.![FromQuery and other ASP.NET Core Web API attributes](/media/zrodynel/cover-4.png?width=350&height=197&v=1d9c706fa669ba0)
FromQuery and other ASP.NET Core Web API attributes
An ASP.NET Core code sample that features examples of FromQuery, FromHeader, FromForm, FromRoute, FromServices and FromBody in a Web API.![ASP.NET Core custom logging provider to SQL Server database](/media/qwigqv3n/cover-1.png?width=350&height=197&v=1d9c58cf6ff7390)
ASP.NET Core custom logging provider to SQL Server database
Download & install this .NET code sample written in C# that uses a custom logging provider to log to a SQL Server database table![Create your own file logger](/media/15pmeu3b/custom-logging-provider-to-write-log-files-in-text-files-for-net-core-300x131.png?width=350&height=197&v=1d9c3a4060ae350)
Create your own file logger
An ASP.NET Core for .NET 5 Web API which extends .NET Core's logging feature to log to text files in a HostedService.![Create a PDF using HTML & CSS in ASP.NET Core](/media/b22gtinw/cover-3.png?width=350&height=197&v=1d9c4750c318550)
Create a PDF using HTML & CSS in ASP.NET Core
Download the code example to allow you to create free PDF documents in ASP.NET Core. Capture a website layout and create an invoice.
Watch .NET tutorials
Subscribe to our YouTube channel