Show / Hide Table of Contents

Class TaskType

Provides specialized reflection methods for task types.

Inheritance
object
TaskType
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class TaskType

Properties

| Edit this page View Source

IsCompletedSuccessfullyGetter

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 Source

GetIsCompletedGetter(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 task.

| Edit this page View Source

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.

| Edit this page View Source

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 taskType is not a task type.

| Edit this page View Source

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 taskResult is void; or Task<TResult> or ValueTask<TResult> with actual generic argument equals to taskResult.

See Also
Task
Task<TResult>
ValueTask
ValueTask<TResult>

See Also

Task
Task<TResult>
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾