C# Union Types, Async Validation and Azure Functions
This issue covers collection expressions, efficient database validation, ThreadPool starvation, Microsoft Graph distribution lists, and file writing.
Jasen's top three picks
- 1 C# 15 Union Types: Where They Actually Help in Application Code
C# Corner
Union types can make business outcomes explicit instead of hiding them behind nulls or generic response objects.
- 2 Making Everyday C# Code Cleaner With Collection Expressions
C# Corner
A practical look at collection expressions, including target typing and spread elements.
- 3 Memory
vs Span in C#: Understanding Their Real Differences Medium
A useful comparison when choosing between Memory
and Span .
Editor's note
I’ve curated a varied mix of language features, application performance, and migration guidance. The ThreadPool starvation article explains how blocking calls slow APIs, while the Azure Functions guide walks through the move to isolated workers.
Today's articles
C# 15 Union Types: Where They Actually Help in Application Code
C# Corner
Learn when C# union types help model explicit business outcomes, replacing ambiguous null values and generic response objects with clearer result contracts.
Topics: C#
Read articleMaking Everyday C# Code Cleaner With Collection Expressions
C# Corner
Learn how to use C# 12 collection expressions to initialize arrays, lists, spans, and interfaces, including empty collections, target typing, and spread elements.
Topics: C#
Read article Memory vs Span in C#: Understanding Their Real Differences
Medium
In C#, we often work with arrays, strings, and collections.
Topics: C# Performance
Read articleAvoiding Slow Database Calls During Async Validation in ASP.NET Core
C# Corner
Learn how to implement efficient asynchronous validation in ASP.NET Core with FluentValidation and Entity Framework Core while reducing unnecessary database queries.
Topics: ASP.NET Core EF Core FluentValidation
Read articleAzure Functions In-Process Support Has Ended: Migrating to the Isolated Worker Model on .NET 10
Medium
A step-by-step, before-and-after guide to moving your .NET Function apps to the supported model.
Topics: Azure Functions .NET 10
Read articleUsing Microsoft Graph to Manage Distribution Lists From a .NET Application
C# Corner
Learn how a .NET application can use Microsoft Graph to identify and report on Microsoft 365 distribution lists, including Graph's read-only limitations for traditional distribution groups.
Topics: .NET Core
Read articleThreadPool Starvation in .NET: Why Your ASP.NET Core API Becomes Slow and How to Fix It
C# Corner
Learn how ThreadPool starvation slows ASP.NET Core APIs, how blocking calls cause it, and how async/await, Task.Delay, and asynchronous HTTP calls help prevent it.
Topics: ASP.NET Core Performance
Read articleAny Duplicate Within K Distance Using C#
C# Corner
Learn how to detect duplicate values within k indices of an array in C# using a HashSet and sliding window, with examples and complexity analysis.
Topics: C#
Read articleC# Write to File: WriteAllText, WriteAllLines, AppendAllText, and StreamWriter
Khalid Abuhakmeh
How to write to a file in C# with File.WriteAllText, WriteAllLines, WriteAllBytes, AppendAllText, async methods, and StreamWriter, with tested examples.
Topics: C#
Read article