I need to restore data on exception and after throw exception of the same type. Is it possible if in compile time I don't know the type of exception? Thanks.
Have you tried this:
try
{
// your code here.
}
catch (Exception exception)
{
// your code here.
throw exception;
}