Class TaskType
Provides specialized reflection methods for task types.
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class TaskType
Properties
| Edit this page View SourceIsCompletedSuccessfullyGetter
Gets a delegate representing getter method of IsCompletedSuccessfully property.
Declaration
public static Func<Task, bool> IsCompletedSuccessfullyGetter { get; }
Property Value
Type | Description |
---|---|
Func<Task, bool> |
Methods
| Edit this page View SourceGetIsCompletedGetter(Task)
Gets a delegate that representing getter method of IsCompleted property captured for the specified task.
Declaration
public static Func<bool> GetIsCompletedGetter(this Task task)
Parameters
Type | Name | Description |
---|---|---|
Task | task | The task to reflect. |
Returns
Type | Description |
---|---|
Func<bool> | The delegate representing IsCompleted property of |
GetResultGetter<T>()
Gets delegate representing getter of Result property.
Declaration
public static Func<Task<T>, T> GetResultGetter<T>()
Returns
Type | Description |
---|---|
Func<Task<T>, T> | The delegate representing Result property getter. |
Type Parameters
Name | Description |
---|---|
T | The type of task result. |
GetTaskType(Type)
Obtains result type from task type.
Declaration
public static Type? GetTaskType(this Type taskType)
Parameters
Type | Name | Description |
---|---|---|
Type | taskType | A type of Task or Task<TResult>. |
Returns
Type | Description |
---|---|
Type | Task result type; or null if |
MakeTaskType(Type, bool)
Returns task type for the specified result type.
Declaration
public static Type MakeTaskType(this Type taskResult, bool valueTask = false)
Parameters
Type | Name | Description |
---|---|---|
Type | taskResult | Task result type. |
bool | valueTask | true to make value task type. |
Returns
Type | Description |
---|---|
Type | Returns Task or ValueTask if |