DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.12.0" />

 TaskType

public static class TaskType
Provides specialized reflection methods for task types.
public static Func<Task, bool> IsCompletedSuccessfullyGetter { get; }

Gets a delegate representing getter method of IsCompletedSuccessfully property.

public static Func<bool> GetIsCompletedGetter(this Task task)

Gets a delegate that representing getter method of IsCompleted property captured for the specified task.

public static Func<Task<T>, T> GetResultGetter<T>()

Gets delegate representing getter of Result property.

public static Type GetTaskType(this Type taskType)

Obtains result type from task type.

public static Type MakeTaskType(this Type taskResult)

Returns task type for the specified result type.

public static Type MakeTaskType(this Type taskResult, bool valueTask)

Returns task type for the specified result type.