Exploring Pattern Matching in C#
summary
Walks through C# 7 pattern matching: shows is expressions that test and extract in one line, switch with when guards that order-case and introduce block scopes, and the constant/type/null patterns including surprising null behavior for nullable ints and strings. Refactors two real projects (NotATime and a tag helper) to replace nested ifs, cutting roughly 15–20 lines and clarifying four distinct cases. Explains variable scoping, definite assignment rules, and future patterns like var/wildcard/positional.
AI-written summary · about
chapters (4)
related talks
37mC# 8 and Beyond
56mChange your habits: Modern techniques for modern C#
47mExploring C# 8: The Deep Dive
01h 06mThe top 10 best new features in C# version 6 to 9
56mC# 8 and Beyond
01h 00mLet’s catch up with C#! Exciting new features in C# 9 to C# 14!
39mThe State of C# - What Have I Missed?
58mWhat's new in C# 11
