November Happy Hour will be moved to Thursday December 5th.

Interface IAsyncDatabaseExecutor

An asynchronous version of IDatabaseExecutor

Namespace: EPiServer.Data
Assembly: EPiServer.Data.dll
Version: 10.10.4
Syntax
public interface IAsyncDatabaseExecutor : IDatabaseExecutor
Remarks

Asynchronous methods does not support nesting which means a new connection is opened for every call to any async method

Methods

ExecuteAsync(Func<Task>)

An asynchronous version of Execute, opens a connection and executes the function with access to the open connection

Declaration
Task ExecuteAsync(Func<Task> action)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task> action
Returns
Type Description
System.Threading.Tasks.Task

ExecuteAsync<TResult>(Func<Task<TResult>>)

An asynchronous version of Execute, opens a connection and executes the function with access to the open connection

Declaration
Task<TResult> ExecuteAsync<TResult>(Func<Task<TResult>> action)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task<TResult>> action
Returns
Type Description
System.Threading.Tasks.Task<TResult>
Type Parameters
Name Description
TResult

ExecuteTransactionAsync(Func<Task>)

An asynchronous version of ExecuteTransaction, opens a connection and transaction and executes the System.Action with access to the open connection

Declaration
Task ExecuteTransactionAsync(Func<Task> action)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task> action
Returns
Type Description
System.Threading.Tasks.Task

ExecuteTransactionAsync<TResult>(Func<Task<TResult>>)

An asynchronous version of ExecuteTransaction, opens a connection and transaction and executes the System.Action with access to the open connection

Declaration
Task<TResult> ExecuteTransactionAsync<TResult>(Func<Task<TResult>> action)
Parameters
Type Name Description
System.Func<System.Threading.Tasks.Task<TResult>> action
Returns
Type Description
System.Threading.Tasks.Task<TResult>
Type Parameters
Name Description
TResult

Extension Methods