Skip to main content

TaskExtensions

Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class TaskExtensions

Methods

Success<T>(Task<T>, Action<T>, Boolean, TaskContinuationOptions)

View Source
Declaration
public static Task<T> Success<T>(this Task<T> task, Action<T> fn, bool onUiThread = true, TaskContinuationOptions taskOptions = TaskContinuationOptions.OnlyOnRanToCompletion)
Returns

System.Threading.Tasks.Task<<T>>

Parameters
TypeName
System.Threading.Tasks.Task<<T>>task
System.Action<<T>>fn
System.BooleanonUiThread
System.Threading.Tasks.TaskContinuationOptionstaskOptions
Type Parameters
  • T

Success(Task, Action, Boolean, TaskContinuationOptions)

View Source
Declaration
public static Task Success(this Task task, Action fn, bool onUiThread = true, TaskContinuationOptions taskOptions = TaskContinuationOptions.OnlyOnRanToCompletion)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.Tasks.Tasktask
System.Actionfn
System.BooleanonUiThread
System.Threading.Tasks.TaskContinuationOptionstaskOptions

Error<T>(Task<T>, Action<Exception>, Boolean, TaskContinuationOptions)

View Source
Declaration
public static Task<T> Error<T>(this Task<T> task, Action<Exception> fn, bool onUiThread = true, TaskContinuationOptions taskOptions = TaskContinuationOptions.OnlyOnFaulted)
Returns

System.Threading.Tasks.Task<<T>>

Parameters
TypeName
System.Threading.Tasks.Task<<T>>task
System.Action<System.Exception>fn
System.BooleanonUiThread
System.Threading.Tasks.TaskContinuationOptionstaskOptions
Type Parameters
  • T

Error(Task, Action<Exception>, Boolean, TaskContinuationOptions)

View Source
Declaration
public static Task Error(this Task task, Action<Exception> fn, bool onUiThread = true, TaskContinuationOptions taskOptions = TaskContinuationOptions.OnlyOnFaulted)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.Tasks.Tasktask
System.Action<System.Exception>fn
System.BooleanonUiThread
System.Threading.Tasks.TaskContinuationOptionstaskOptions

UnwrapIfSingleException<T>(Task<T>)

View Source
Declaration
public static Exception UnwrapIfSingleException<T>(this Task<T> task)
Returns

System.Exception

Parameters
TypeName
System.Threading.Tasks.Task<<T>>task
Type Parameters
  • T

UnwrapIfSingleException(Task)

View Source
Declaration
public static Exception UnwrapIfSingleException(this Task task)
Returns

System.Exception

Parameters
TypeName
System.Threading.Tasks.Tasktask

UnwrapIfSingleException(Exception)

View Source
Declaration
public static Exception UnwrapIfSingleException(this Exception ex)
Returns

System.Exception

Parameters
TypeName
System.Exceptionex