c# exception pattern matching

Pattern matching overview C# guide Microsoft Learn. Pattern matching is a technique where you test an expression to determine if it has certain characteristics. C# pattern matching provides more concise syntax for testing expressions and taking action when an expression matches. The " is expression" supports pattern matching to test an expression and conditionally dec… See more

Pattern matching overview C# guide Microsoft Learn
Pattern matching overview C# guide Microsoft Learn from i.stack.imgur.com

Web  catch(Exception e) when (((e as AggregateException)?.InnerException ?? e) is ValueException ve) { //. } It's your one-liner to catch exception if it either was.

0 komentar