Class TaskExtensions
Extension methods for converting 's and 's to 's
and 's with Result objects.
Inheritance
System.Object
TaskExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: p1eXu5.Result.dll
Syntax
public static class TaskExtensions
Methods
|
Improve this Doc
View Source
TaskApply<TContextA, TContextB>(Task<TContextA>, Task<Func<TContextA, TContextB>>)
Declaration
public static async Task<TContextB> TaskApply<TContextA, TContextB>(this Task<TContextA> task, Task<Func<TContextA, TContextB>> f)
Parameters
Type |
Name |
Description |
Task<TContextA> |
task |
|
Task<Func<TContextA, TContextB>> |
f |
|
Returns
Type |
Description |
Task<TContextB> |
|
Type Parameters
Name |
Description |
TContextA |
|
TContextB |
|
|
Improve this Doc
View Source
TaskMap<TContextA, TContextB>(Task<TContextA>, Func<TContextA, TContextB>)
Declaration
public static async Task<TContextB> TaskMap<TContextA, TContextB>(this Task<TContextA> task, Func<TContextA, TContextB> f)
Parameters
Type |
Name |
Description |
Task<TContextA> |
task |
|
Func<TContextA, TContextB> |
f |
|
Returns
Type |
Description |
Task<TContextB> |
|
Type Parameters
Name |
Description |
TContextA |
|
TContextB |
|
|
Improve this Doc
View Source
ToTaskResult(Task, CancellationToken)
Declaration
public static Task<Result<ValueTuple, Exception>> ToTaskResult(this Task task, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
Task |
task |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<Result<ValueTuple, Exception>> |
|
|
Improve this Doc
View Source
ToTaskResult<TContext>(Task<TContext>, CancellationToken)
Returns <Result<TContext
>> from <TContext
>.
Declaration
public static Task<Result<TContext, Exception>> ToTaskResult<TContext>(this Task<TContext> task, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
Task<TContext> |
task |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<Result<TContext, Exception>> |
|
Type Parameters
Name |
Description |
TContext |
|
|
Improve this Doc
View Source
ToValueTaskResult(Task, CancellationToken)
Declaration
public static ValueTask<Result<ValueTuple, Exception>> ToValueTaskResult(this Task task, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
Task |
task |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
ValueTask<Result<ValueTuple, Exception>> |
|
|
Improve this Doc
View Source
ToValueTaskResult(ValueTask, CancellationToken)
Declaration
public static ValueTask<Result<ValueTuple, Exception>> ToValueTaskResult(this ValueTask task, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
ValueTask |
task |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
ValueTask<Result<ValueTuple, Exception>> |
|
|
Improve this Doc
View Source
ToValueTaskResult<TContext>(Task<TContext>, CancellationToken)
Returns <Result<TContext
>> from <TContext
>.
Declaration
public static ValueTask<Result<TContext, Exception>> ToValueTaskResult<TContext>(this Task<TContext> task, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
Task<TContext> |
task |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
ValueTask<Result<TContext, Exception>> |
|
Type Parameters
Name |
Description |
TContext |
|
|
Improve this Doc
View Source
ToValueTaskResult<TContext>(ValueTask<TContext>, CancellationToken)
Returns <Result<TContext
>> from <TContext
>.
Declaration
public static ValueTask<Result<TContext, Exception>> ToValueTaskResult<TContext>(this ValueTask<TContext> task, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
ValueTask<TContext> |
task |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
ValueTask<Result<TContext, Exception>> |
|
Type Parameters
Name |
Description |
TContext |
|