csharp
Explore articles, tutorials, and insights about csharp — covering practical tips, best practices, and real-world examples.
10 articlesC# CancellationToken Best Practices for Web API
2026/05/15·12 min readLearn the best practices for using CancellationToken in ASP.NET Core Web APIs, with real-world code samples, client/server demos, and practical guidance for robust cancellation handling.
Modern C# Language Features: Pattern Matching, Records, and More
2026/05/05·18 min readExplore modern C# features from C# 7 to 13, including pattern matching, records, collection expressions, and primary constructors for cleaner, more expressive code.
C# ValueTask vs Task in Three-Tier APIs — When to Use Each
2026/03/02·16 min readUnderstand when to use Task vs ValueTask in ASP.NET Core three-tier APIs, with practical examples for cache-heavy, always-I/O, and batch aggregation scenarios.
C# Task Combinators: Task.WhenAll, Task.WhenAny, Task.WhenEach, and Parallel.ForEachAsync
2026/02/18·13 min readLearn when to use Task.WhenAll, Task.WhenAny, Task.WhenEach, and Parallel.ForEachAsync, including practical patterns for primary/fallback concurrency in real apps.
C# Configuration & Options Pattern - Cheatsheet
2026/02/04·3 min readOne-page quick reference for ASP.NET Core configuration, Options pattern, and DI registration patterns.
ConfigureAwait(false) in C# and ASP.NET Core: Deadlocks, 3-Tier API, and Library Rules
2026/01/18·20 min readLearn exactly what ConfigureAwait(false) does, when it prevents deadlocks, why ASP.NET Core usually does not need it, and how to apply it correctly in reusable library code.
C# Deadlocks and SynchronizationContext — Why ASP.NET Core Doesn't Have It
2026/01/05·16 min readMaster SynchronizationContext, understand how .Result and .Wait() cause deadlocks in WPF/WinForms/ASP.NET Framework, and why ASP.NET Core eliminated this problem entirely.
C# Configuration & Options Pattern
2026/01/02·8 min readPractical guide to configuration in ASP.NET Core using the Options pattern, validation, named options and reload strategies.
C# Dependency Injection & Service Lifetimes
2025/03/04·35 min readMaster dependency injection in ASP.NET Core with a complete guide to transient, scoped, and singleton lifetimes, captive dependencies, and real-world 3-layer architecture patterns.
How to Use C# Enum Flag
2020/12/11·1 min readA quick code snippet showing how to use C# enum flags with the power of two for defining combinable flag values.