ExecutionStrategy.CallOnWrappedException<TResult> Method

Definition

Recursively gets InnerException from exception as long as it is an exception created by Entity Framework and calls exceptionHandler on the innermost one.

public static TResult CallOnWrappedException<TResult> (Exception exception, Func<Exception,TResult> exceptionHandler);
static member CallOnWrappedException : Exception * Func<Exception, 'Result> -> 'Result
Public Shared Function CallOnWrappedException(Of TResult) (exception As Exception, exceptionHandler As Func(Of Exception, TResult)) As TResult

Type Parameters

TResult

The return type of exceptionHandler.

Parameters

exception
Exception

The exception to be unwrapped.

exceptionHandler
Func<Exception,TResult>

A delegate that will be called with the unwrapped exception.

Returns

TResult

The result from exceptionHandler.

Remarks

See Connection resiliency and database retries for more information and examples.

Applies to