A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Interface IAsyncDatabaseHandler

An asynchronous version of IDatabaseHandler

Namespace: EPiServer.Data
Assembly: EPiServer.Framework.AspNet.dll
Version: 11.20.7
Syntax
[Obsolete("Use IAsyncDatabaseExecutor instead")]
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