DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.2.0-beta.1" />

 Conversion

public static class Conversion
Provides task result conversion methods.
public static DynamicTaskAwaitable AsDynamic(this Task task)

Allows to convert Task<T> of unknown result type into dynamically typed task which result can be obtained as Object or any other data type using dynamic approach.

public static Task<TOutput> Convert<TInput, TOutput>(this Task<TInput> task) where TInput : TOutput

Converts one type of task into another.

public static Task<TOutput> Convert<TInput, TOutput>(this Task<TInput> task, Converter<TInput, TOutput> converter)

Converts one type of task into another.

public static Task<TOutput> Convert<TInput, TOutput>(this Task<TInput> task, Converter<TInput, Task<TOutput>> converter)

Converts one type of task into another.

public static Task<T?> ToNullable<T>(this Task<T> task) where T : struct

Converts value type into nullable value type.