Method ExecuteTask
ExecuteTask<T>(Func<T>)
Executes a task asynchronously and returns the result.
public Task<T> ExecuteTask<T>(Func<T> action)
Parameters
action
Func<T>The action to be executed.
Returns
- Task<T>
A task representing the asynchronous operation.
Type Parameters
T
The type of the result.
ExecuteTask<T>(Func<object, T>, object)
Executes a task asynchronously with an argument and returns the result.
public Task<T> ExecuteTask<T>(Func<object, T> action, object argument)
Parameters
action
Func<object, T>The action to be executed.
argument
objectThe argument to be passed to the action.
Returns
- Task<T>
A task representing the asynchronous operation.
Type Parameters
T
The type of the result.
ExecuteTask(Action<object>, object)
Executes a task asynchronously with an argument.
public Task ExecuteTask(Action<object> action, object argument)
Parameters
action
Action<object>The action to be executed.
argument
objectThe argument to be passed to the action.
Returns
- Task
A task representing the asynchronous operation.
ExecuteTask(Action, CancellationTokenSource)
Executes a task asynchronously.
public Task ExecuteTask(Action action, CancellationTokenSource tokenSource = null)
Parameters
action
ActionThe action to be executed.
tokenSource
CancellationTokenSourceThe cancellation token source.
Returns
- Task
A task representing the asynchronous operation.