Pattern Matching in C#

Published: 01 October 2020
on channel: Filip Ekberg
17,684
613

In this video we are exploring pattern matching in C#. This is a great addition to the C# language and is something I've personally been using in other programming languages!

With C# 9.0 pattern matching has been improved to add more patterns. We now have the following additional patterns:

1. Type patterns
2. Conjunctive and patterns
3. Disjunctive or patterns
4. Negated not patterns
5. Parenthesized patterns
6. Relational patterns

Learn more about the news in C# 9.0 at the Microsoft Docs: https://docs.microsoft.com/en-us/dotn...

Follow me on Twitter: @fekberg   / fekberg  

Check out my courses on Pluralsight: https://pluralsight.pxf.io/d1MRK

Office background by: https://unsplash.com/@sunday_digital

Table of contents:
00:00 What is pattern matching?
01:24 Pattern matching in C#
01:53 Pattern matching in C# 8.0
02:35 Switch expression in C# 8.0
04:11 Positional pattern
04:47 Property pattern
05:05 Tuple pattern
05:20 Pattern matching in C# 9.0
06:40 Type pattern
08:20 Relational pattern
09:40 Conjunctive "and" pattern
11:21 Disjunctive "or" pattern
13:12 Parenthesized pattern
13:40 Negated "not" pattern

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the links, I may receive a small commission.


Watch video Pattern Matching in C# online without registration, duration hours minute second in high quality. This video was added by user Filip Ekberg 01 October 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 17,684 once and liked it 613 people.