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

Interface IAsyncDatabaseHandler

An asynchronous version of IDatabaseHandler

Namespace: EPiServer.Data
Assembly: EPiServer.Data.dll
Version: 9.12.2
Syntax
public interface IAsyncDatabaseHandler : IDatabaseHandler
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