<PackageReference Include="Microsoft.Bcl" Version="1.1.9" />

System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>

public struct AsyncTaskMethodBuilder<TResult> : IAsyncMethodBuilder
Provides a builder for asynchronous methods that return Task<T>. This type is intended for compiler use only.
public Task<TResult> Task { get; }

Gets the Task<T> for this builder.

public static AsyncTaskMethodBuilder<TResult> Create()

Initializes a new AsyncTaskMethodBuilder.

public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine

Schedules the specified state machine to be pushed forward when the specified awaiter completes.

public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine

Schedules the specified state machine to be pushed forward when the specified awaiter completes.

public void SetException(Exception exception)

Completes the Task<T> in the TaskStatusFaulted state with the specified exception.

public void SetResult(TResult result)

Completes the Task<T> in the TaskStatusRanToCompletion state with the specified result.

public void SetStateMachine(IAsyncStateMachine stateMachine)

Associates the builder with the state machine it represents.

public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine

Initiates the builder's execution with the associated state machine.