C# equivalent to VB.NET Catch ... When
- by fung
In VB.NET I often Catch ... When ...
Try
' Some code'
Catch e As ArgumentNullException When e.ParamName.ToUpper() = "SAMPLES"
' Handle the error'
End Try
Is there a C# equivalent to Catch ... When?
I don't want to resort to using an if statement inside a catch if possible.