A short reference post demonstrating three ways to use pattern matching in C#: with an if/else chain, a switch statement with a return, and a switch expression body. All examples use generic methods to match on int and string types, showing the syntax differences between each approach.
1 Impression