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
Type | Name |
---|---|
System.Threading.Tasks.Task<<T>> | task |
System.Action<<T>> | fn |
System.Boolean | onUiThread |
System.Threading.Tasks.TaskContinuationOptions | taskOptions |
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
Type | Name |
---|---|
System.Threading.Tasks.Task | task |
System.Action | fn |
System.Boolean | onUiThread |
System.Threading.Tasks.TaskContinuationOptions | taskOptions |
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
Type | Name |
---|---|
System.Threading.Tasks.Task<<T>> | task |
System.Action<System.Exception> | fn |
System.Boolean | onUiThread |
System.Threading.Tasks.TaskContinuationOptions | taskOptions |
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
Type | Name |
---|---|
System.Threading.Tasks.Task | task |
System.Action<System.Exception> | fn |
System.Boolean | onUiThread |
System.Threading.Tasks.TaskContinuationOptions | taskOptions |
UnwrapIfSingleException<T>(Task<T>)
View Source
Declaration
public static Exception UnwrapIfSingleException<T>(this Task<T> task)
Returns
System.Exception
Parameters
Type | Name |
---|---|
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
Type | Name |
---|---|
System.Threading.Tasks.Task | task |
UnwrapIfSingleException(Exception)
View Source
Declaration
public static Exception UnwrapIfSingleException(this Exception ex)
Returns
System.Exception
Parameters
Type | Name |
---|---|
System.Exception | ex |