I have a Method that get paramater of type – Exception
WriteException(Exception ex, int index, string s)
{
// my code here...
}
sometimes the method gets an Exception object and sometimes SoapException
every time the exeption is of kind SoapException I want print: ex.Detail.InnerText
but if ex is of type Exception.
so after I recognize the type, how can I do SoapException ex.Detail.InnerText?
another possible solution uses the
dynamickeyword: