Skip to main content

C# Tutorials: Language Features, Patterns and Performance

Last updated: October 5, 2026

Every C# language article on this site in one place: what changed in recent versions, the core features you use daily, writing fast code, design patterns, testing, and writing secure code. Posts marked tested on .NET 10 were rewritten from a working project, with real compiler errors, output and measurements.

Hit one of these? Start here

You see thisRead this
CS0131 on new int[5] { [^1] = 1 }, or not sure which C# 13/14 feature needs which .NET versionC# 13 and C# 14 features
params ReadOnlySpan<T> and an existing array picking different overloadsC# 13: params collections, measured
CS0150 when the column width in {value,width} is a variableString interpolation and alignment
Two SaveChanges calls and half the data written after a failureRepository and Unit of Work with EF Core
Visual Studio suggests IDE0290 Use primary constructor and you are not sure it is safePrimary constructors explained

1. What's new in C#

  • C# 13 and C# 14 features: params collections with measured allocations, the new Lock type benchmarked, partial properties, the field keyword and what C# 14 added on .NET 10. (rewritten and tested on .NET 10)
  • Primary constructors: how the parameters are captured, classes vs records, and the pitfalls before you accept IDE0290 everywhere.
  • Pattern matching: type, property and list patterns, switch expressions and when guards.
  • Nullable reference types: enabling them, reading the warnings, the nullable attributes and migrating an existing codebase.
  • Records vs classes vs structs: value vs reference semantics and a decision cheat sheet.
  • Extension methods: writing them well, real examples, and extension members in C# 14.

2. Core language

  • Generics: generic classes and methods, constraints and real-world uses.
  • Delegates, events, Func and Action: from a delegate type to events with EventHandler<T>, and the closure trap in loops.
  • Interface vs abstract class: the real differences, default interface methods and when to pick each.
  • Async/await: how it works underneath, concurrent calls, and the common mistakes.
  • Exception handling: custom exceptions, logging them properly, and exceptions vs the Result pattern.
  • LINQ: Where, Select, OrderBy, GroupBy and aggregates on everyday data.
  • Access modifiers: public, private, protected, internal and protected internal in one short reference.

3. Strings, collections and performance

Measure before you optimise; the profiling guide shows how.

4. Design and architecture

5. Testing and team practice

6. Writing secure C#

7. C# beyond the backend

  • .NET MAUI: a first cross-platform app with XAML, MVVM and API calls.
  • C# for Unity: how Unity C# differs, events and time, the fake-null trap and performance.

Related guides

Building web APIs with these features? The ASP.NET Core tutorials guide covers APIs, security, observability and deployment.

Comments

Popular posts from this blog

.NET MAUI Tutorial 2026: Build Cross-Platform Apps in C#

Learn .NET MAUI in 2026 to build iOS, Android, Windows & Mac apps from one C# codebase. Start this cross-platform tutorial with code examples today. .NET MAUI (Multi-platform App UI) is Microsoft's framework for building native iOS, Android, Windows, and macOS apps from a single C# codebase . If you've ever wanted to ship a mobile app without learning Swift, Kotlin, and Win32 separately, this .NET MAUI tutorial for 2026 is your starting point. In this guide you'll learn what .NET MAUI is, why it matters for cross-platform app development in C#, and how to build your first working app — with runnable code examples and the best practices senior engineers actually use in production. What Is .NET MAUI and Why Use It in 2026? .NET MAUI is the evolution of Xamarin.Forms, fully integrated into the modern .NET runtime. With one project and one language — C# — you target four platforms. The framework compiles to native UI controls on each device, so a button on iOS...

Angular 14 : 404 error during refresh page after deployment

In this article, We will learn how to solve 404 file or directory not found angular error in production.  Refresh browser angular 404 file or directory not found error You have built an Angular app and created a production build with ng build --prod You deploy it to a production server. Everything works fine until you refresh the page. The app throws The requested URL was not found on this server message (Status code 404 not found). It appears that angular routing not working on the production server when you refresh the page. The error appears on the following scenarios When you type the URL directly in the address bar. When you refresh the page The error appears on all the pages except the root page.   Reason for the requested URL was not found on this server error In a Multi-page web application, every time the application needs to display a page it has to send a request to the web server. You can do that by either typing the URL in the address bar, clicking on the Me...

Angular 14 CRUD Operation with Web API .Net 6.0

How to Perform CRUD Operation Using Angular 14 In this article, we will learn the angular crud (create, read, update, delete) tutorial with ASP.NET Core 6 web API. We will use the SQL Server database and responsive user interface for our Web app, we will use the Bootstrap 5. Let's start step by step. Step 1 - Create Database and Web API First we need to create Employee database in SQL Server and web API to communicate with database. so you can use my previous article CRUD operations in web API using net 6.0 to create web API step by step. As you can see, after creating all the required API and database, our API creation part is completed. Now we have to do the angular part like installing angular CLI, creating angular 14 project, command for building and running angular application...etc. Step 2 - Install Angular CLI Now we have to install angular CLI into our system. If you have already installed angular CLI into your system then skip this step.  To install angular CLI ope...