The is pattern expression allows you to evaluate patterns. But you can also evaluate patterns in a switch expression. In this blog post, we use switch expressions. But before we do that, let’s go a bit back and let’s look at switch statements before C# 7.0 to understand how they have evolved.

#csharp 

How to use Pattern Matching in Switch Expressions C# 9.0
1.55 GEEK