DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="1.1.0" />

 Continuation

public static class Continuation
Represents various continuations.
public static Task<T> OnCanceled<T, C>(this Task<T> task, TaskScheduler scheduler = null) where C : Constant<T>

Returns constant value if underlying task is canceled.

public static Task<Task> OnCompleted(this Task task)

Allows to obtain original Task in its final state after await without throwing exception produced this task.

public static Task<Task<R>> OnCompleted<R>(this Task<R> task)

Allows to obtain original Task<T> in its final state after await without throwing exception produced this task.

public static Task<T> OnFaulted<T, C>(this Task<T> task, TaskScheduler scheduler = null) where C : Constant<T>

Returns constant value if underlying task is failed.

public static Task<T> OnFaultedOrCanceled<T, C>(this Task<T> task, TaskScheduler scheduler = null) where C : Constant<T>

Returns constant value if underlying task is failed or canceled.