C# 6 Exception Filters and How they are much more than Syntactic Sugar

added by DotNetKicks
2/16/2015 3:42:22 PM

3 Kicks, 196 Views

Exception Filters are a new feature in C# 6 which allows you to specify conditions along with a catch block. The catch block is only executed if the condition satisfies. The following code, illustrates the syntax. When you run it, it should display "caught E2".