129. Pattern Matching in C-sharp: Getting Started
https://www.betabit.nl/betatalks Christian and Yvo explain how pattern matching in C# helps make code more concise and readable. They show how switch expressions and different pattern types can replace complex if/else logic while handling edge cases safely. Through examples like discounts, validations, and list parsing, Christian demonstrates how business rules can be expressed clearly and compactly. They conclude that pattern matching is a powerful and readable way to express business logic. Links for more information - https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching Timestamps: 00:00 - Introduction patterns matching in C-sharp 01:23 - Demo: switch expressions vs classic switch 02:57 - Relational patterns 04:20 - Logical patterns AND, OR, NOT 06:34 - Type pattern matching 08:26 - Property pattern matching 09:33 - Positional pattern matching 12:10 - Property patterns on domain objects 13:59 - Combining positional/property patterns with when 15:46 - List patterns 16:55 - Advanced list patterns with “crappy CSV” 19:20 - Closing remarks and wrap-up There is more to come! https://www.betabit.nl/nl
Download
0 formatsNo download links available.