ToException
Turns any object to Exception. Very useful!
Source
public static Exception ToException(this object o)
{
return new Exception(o.ToString());
}
Example
Object o = new Object();
throw o.ToException();
ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods
Turns any object to Exception. Very useful!
public static Exception ToException(this object o)
{
return new Exception(o.ToString());
}
Object o = new Object();
throw o.ToException();