Skip to main content

TaskExt

Assembly: ServiceStack.Common.dll
View Source
Declaration
public static class TaskExt

Methods

AsTaskException(Exception)

View Source
Declaration
public static Task<object> AsTaskException(this Exception ex)
Returns

System.Threading.Tasks.Task<System.Object>

Parameters
TypeName
System.Exceptionex

AsTaskException<T>(Exception)

View Source
Declaration
public static Task<T> AsTaskException<T>(this Exception ex)
Returns

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

Parameters
TypeName
System.Exceptionex
Type Parameters
  • T

AsTaskResult<T>(T)

View Source
Declaration
public static Task<T> AsTaskResult<T>(this T result)
Returns

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

Parameters
TypeName
<T>result
Type Parameters
  • T

GetResult(Task)

View Source
Declaration
public static object GetResult(this Task task)
Returns

System.Object

Parameters
TypeName
System.Threading.Tasks.Tasktask

GetResult<T>(Task<T>)

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

<T>

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

RunSync(Func<Task>)

View Source
Declaration
public static void RunSync(Func<Task> task)
Parameters
TypeName
System.Func<System.Threading.Tasks.Task>task

RunSync<TResult>(Func<Task<TResult>>)

View Source
Declaration
public static TResult RunSync<TResult>(Func<Task<TResult>> task)
Returns

<TResult>

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

AsValueTask(Task)

View Source
Declaration
public static ValueTask AsValueTask(this Task task)
Returns

ValueTask

Parameters
TypeName
System.Threading.Tasks.Tasktask

AsValueTask<T>(Task<T>)

View Source
Declaration
public static ValueTask<T> AsValueTask<T>(this Task<T> task)
Returns

ValueTask<<T>>

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

AsTask(Task)

View Source
Declaration
public static Task AsTask(this Task task)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.Tasks.Tasktask