Table of Contents

Class TaskHelper

Namespace
Acuit.Pinpoint.Common
Assembly
Acuit.Pinpoint.Common.dll

Helpers for working with Tasks.

public static class TaskHelper
Inheritance
TaskHelper
Inherited Members

Methods

ForceExceptionsIntoTaskAsync(Func<Task>)

Executes an asynchronous method, ensuring any exceptions thrown synchronously are reported via the returned Task.

public static Task ForceExceptionsIntoTaskAsync(Func<Task> function)

Parameters

function Func<Task>

The asynchronous method to execute.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

ArgumentNullException

function is null. This exception will be thrown synchronously, not returned through the returned Task object.

ForceExceptionsIntoTaskAsync<TResult>(Func<Task<TResult>>)

Executes an asynchronous method, ensuring any exceptions thrown synchronously are reported via the returned Task<TResult>.

public static Task<TResult> ForceExceptionsIntoTaskAsync<TResult>(Func<Task<TResult>> function)

Parameters

function Func<Task<TResult>>

The asynchronous method to execute.

Returns

Task<TResult>

A task that represents the asynchronous operation. The value of its Result property contains the result.

Type Parameters

TResult

The type of the result produced by the Task<TResult>.

Exceptions

ArgumentNullException

function is null. This exception will be thrown synchronously, not returned through the returned Task<TResult> object.