C# Dynamic Keyword exception handling
- by user972255
The below code throws an exception when executing this line (i.e. something.Add(name)).
I want to catch the actual exception when executing this. I mean I don't want to use catch(Exception ex) instead of that I want to know what is the correct exception thrown here.
try
{
dynamic name= "test";
var something = new List<decimal>();
something.Add(name);
}
catch(Exception ex)
{
throw ex;
}
Thanks in advance.