RelationalExecutionStrategyExtensions.ExecuteInTransaction 方法

定义

重载

ExecuteInTransaction(IExecutionStrategy, Action, Func<Boolean>, IsolationLevel)

在事务中执行指定的操作。 允许检查提交期间发生错误时事务是否已回滚。

ExecuteInTransaction<TResult>(IExecutionStrategy, Func<TResult>, Func<Boolean>, IsolationLevel)

在事务中执行指定的操作并返回结果。 允许检查提交期间发生错误时事务是否已回滚。

ExecuteInTransaction<TState,TResult>(IExecutionStrategy, TState, Func<TState,TResult>, Func<TState,Boolean>, IsolationLevel)

在事务中执行指定的操作并返回结果。 允许检查提交期间发生错误时事务是否已回滚。

ExecuteInTransaction<TState>(IExecutionStrategy, TState, Action<TState>, Func<TState,Boolean>, IsolationLevel)

在事务中执行指定的操作。 允许检查提交期间发生错误时事务是否已回滚。

ExecuteInTransaction(IExecutionStrategy, Action, Func<Boolean>, IsolationLevel)

Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs

在事务中执行指定的操作。 允许检查提交期间发生错误时事务是否已回滚。

public static void ExecuteInTransaction (this Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy strategy, Action operation, Func<bool> verifySucceeded, System.Data.IsolationLevel isolationLevel);
static member ExecuteInTransaction : Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy * Action * Func<bool> * System.Data.IsolationLevel -> unit
<Extension()>
Public Sub ExecuteInTransaction (strategy As IExecutionStrategy, operation As Action, verifySucceeded As Func(Of Boolean), isolationLevel As IsolationLevel)

参数

strategy
IExecutionStrategy

将用于执行的策略。

operation
Action

表示可执行操作的委托。

verifySucceeded
Func<Boolean>

一个委托,用于测试操作是否成功,即使提交事务时引发了异常。

isolationLevel
IsolationLevel

要用于该事务的隔离级别。

例外

在配置的重试次数后,操作未成功。

注解

有关详细信息 和示例,请参阅连接复原和数据库重试

适用于

ExecuteInTransaction<TResult>(IExecutionStrategy, Func<TResult>, Func<Boolean>, IsolationLevel)

Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs

在事务中执行指定的操作并返回结果。 允许检查提交期间发生错误时事务是否已回滚。

public static TResult ExecuteInTransaction<TResult> (this Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy strategy, Func<TResult> operation, Func<bool> verifySucceeded, System.Data.IsolationLevel isolationLevel);
static member ExecuteInTransaction : Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy * Func<'Result> * Func<bool> * System.Data.IsolationLevel -> 'Result
<Extension()>
Public Function ExecuteInTransaction(Of TResult) (strategy As IExecutionStrategy, operation As Func(Of TResult), verifySucceeded As Func(Of Boolean), isolationLevel As IsolationLevel) As TResult

类型参数

TResult

的返回类型 operation

参数

strategy
IExecutionStrategy

将用于执行的策略。

operation
Func<TResult>

表示可返回类型 TResult结果的可执行操作的委托。

verifySucceeded
Func<Boolean>

一个委托,用于测试操作是否成功,即使提交事务时引发了异常。

isolationLevel
IsolationLevel

要用于该事务的隔离级别。

返回

TResult

操作的结果。

例外

在配置的重试次数后,操作未成功。

注解

有关详细信息 和示例,请参阅连接复原和数据库重试

适用于

ExecuteInTransaction<TState,TResult>(IExecutionStrategy, TState, Func<TState,TResult>, Func<TState,Boolean>, IsolationLevel)

Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs

在事务中执行指定的操作并返回结果。 允许检查提交期间发生错误时事务是否已回滚。

public static TResult ExecuteInTransaction<TState,TResult> (this Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy strategy, TState state, Func<TState,TResult> operation, Func<TState,bool> verifySucceeded, System.Data.IsolationLevel isolationLevel);
static member ExecuteInTransaction : Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy * 'State * Func<'State, 'Result> * Func<'State, bool> * System.Data.IsolationLevel -> 'Result
<Extension()>
Public Function ExecuteInTransaction(Of TState, TResult) (strategy As IExecutionStrategy, state As TState, operation As Func(Of TState, TResult), verifySucceeded As Func(Of TState, Boolean), isolationLevel As IsolationLevel) As TResult

类型参数

TState

状态的类型。

TResult

的返回类型 operation

参数

strategy
IExecutionStrategy

将用于执行的策略。

state
TState

将传递给操作的状态。

operation
Func<TState,TResult>

表示可返回类型 TResult结果的可执行操作的委托。

verifySucceeded
Func<TState,Boolean>

一个委托,用于测试操作是否成功,即使提交事务时引发了异常。

isolationLevel
IsolationLevel

要用于该事务的隔离级别。

返回

TResult

操作的结果。

例外

在配置的重试次数后,操作未成功。

注解

有关详细信息 和示例,请参阅连接复原和数据库重试

适用于

ExecuteInTransaction<TState>(IExecutionStrategy, TState, Action<TState>, Func<TState,Boolean>, IsolationLevel)

Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs
Source:
RelationalExecutionStrategyExtensions.cs

在事务中执行指定的操作。 允许检查提交期间发生错误时事务是否已回滚。

public static void ExecuteInTransaction<TState> (this Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy strategy, TState state, Action<TState> operation, Func<TState,bool> verifySucceeded, System.Data.IsolationLevel isolationLevel);
static member ExecuteInTransaction : Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy * 'State * Action<'State> * Func<'State, bool> * System.Data.IsolationLevel -> unit
<Extension()>
Public Sub ExecuteInTransaction(Of TState) (strategy As IExecutionStrategy, state As TState, operation As Action(Of TState), verifySucceeded As Func(Of TState, Boolean), isolationLevel As IsolationLevel)

类型参数

TState

状态的类型。

参数

strategy
IExecutionStrategy

将用于执行的策略。

state
TState

将传递给操作的状态。

operation
Action<TState>

表示可执行操作的委托。

verifySucceeded
Func<TState,Boolean>

一个委托,用于测试操作是否成功,即使提交事务时引发了异常。

isolationLevel
IsolationLevel

要用于该事务的隔离级别。

例外

在配置的重试次数后,操作未成功。

注解

有关详细信息 和示例,请参阅连接复原和数据库重试

适用于