DbExecutionStrategy.UnwrapAndHandleException<T> Method (Exception, Func<Exception, T>)

 

Recursively gets InnerException from exception as long as it is an EntityException, DbUpdateException or UpdateException and passes it to exceptionHandler.

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

public static T UnwrapAndHandleException<T>(
	Exception exception,
	Func<Exception, T> exceptionHandler
)

Parameters

exception
Type: System.Exception

The exception to be unwrapped.

exceptionHandler
Type: System.Func<Exception, T>

A delegate that will be called with the unwrapped exception.

Return Value

Type: T

The result from exceptionHandler.

Type Parameters

T

The type of the unwrapped exception.