共用方式為


DbExecutionStrategy.UnwrapAndHandleException<T> 方法

定義

遞迴會從 exception 取得 InnerException,只要它是 EntityExceptionDbUpdateExceptionUpdateException 就會將其傳遞至 exceptionHandler

public static T UnwrapAndHandleException<T> (Exception exception, Func<Exception,T> exceptionHandler);
static member UnwrapAndHandleException : Exception * Func<Exception, 'T> -> 'T

類型參數

T

未包裝例外狀況的類型。

參數

exception
Exception

要解除包裝的例外狀況。

exceptionHandler
Func<Exception,T>

使用未包裝例外狀況呼叫的委派。

傳回

T

的結果 exceptionHandler

適用於