.NET code examples

ASP.NET Core custom logging provider to SQL Server database

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

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

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.
ASP.NET Core hosted service in .NET 6

ASP.NET Core hosted service in .NET 6

Download a ASP.NET Core hosted example in .NET 6. It's added to the IServiceCollection and uses dependency injection.
ASP.NET Core Google Authentication example in MVC application

ASP.NET Core Google Authentication example in MVC application

A code tutorial for adding Google authentication into an ASP.NET Core 3.1 Web API, including details on how to install it.
Integrate SignalR inside a React app

Integrate SignalR inside a React app

An .NET 5 code example building a React app inside an ASP.NET Core application, with SignalR integration for sending messages.
.NET Worker Service setup to run background tasks as a Windows Service

.NET Worker Service setup to run background tasks as a Windows Service

A .NET 6 Worker Service example running background tasks as hosted services, and setup to run as a Windows Service
.NET 7 code examples for ASP.NET Core

.NET 7 code examples for ASP.NET Core

A preview of what's new for the .NET 7 release, including code examples of ASP.NET Core features to download.
C# 11 features: Download samples

C# 11 features: Download samples

C# 11 features and sample to download. Preview the latest changes in a nutshell, and see what's new with .NET 7.
AppSettings.json example in .NET and C#

AppSettings.json example in .NET and C#

Download our appsettings.json example which focuses on how to read a value, using ConnectionString, environment and logging.