MSDN Documentation

Microsoft Developer Network

.NET Code Samples

Explore a variety of C# and .NET code samples demonstrating best practices and common development patterns. Filter by technology, complexity, or scenario to find what you need.

ASP.NET Core Sample

Building RESTful APIs with ASP.NET Core

Learn how to create efficient and scalable RESTful web APIs using the latest features of ASP.NET Core. Covers routing, controllers, data modeling, and more.

ASP.NET Core Web API C# REST
Xamarin Forms Sample

Cross-Platform Mobile App with Xamarin.Forms

Develop native mobile applications for iOS and Android from a single C# codebase. This sample demonstrates UI layout, data binding, and navigation patterns.

Xamarin.Forms Mobile Development C# Cross-Platform
Entity Framework Core Sample

Data Access with Entity Framework Core

Efficiently manage your application's data using Entity Framework Core. This sample covers entity configuration, migrations, LINQ queries, and CRUD operations.

Entity Framework Core Data Access C# ORM
WPF MVVM Sample

Desktop Applications with WPF and MVVM

Build modern Windows desktop applications using Windows Presentation Foundation (WPF) and the Model-View-ViewModel (MVVM) pattern for maintainability and testability.

WPF MVVM Desktop C#
Azure Functions Sample

Serverless Computing with Azure Functions

Implement serverless logic in the cloud using Azure Functions. This sample shows how to trigger functions from various events and integrate with other Azure services.

Azure Functions Serverless Cloud C#
.NET Console App Sample

Building Console Applications

Master the fundamentals of creating command-line applications with .NET. This sample covers input/output, argument parsing, and basic application structure.

Console App CLI C# Basics