AsyncHelpers.Await Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Await(ConfiguredTaskAwaitable) |
Awaits the specified configured task awaitable and throws any exception produced by the operation. |
| Await(ConfiguredValueTaskAwaitable) |
Awaits the specified configured value task awaitable and throws any exception produced by the operation. |
| Await(Task) |
Awaits the specified Task and throws any exception produced by the operation. |
| Await(ValueTask) |
Awaits the specified ValueTask and throws any exception produced by the operation. |
| Await<T>(ConfiguredTaskAwaitable<T>) |
Awaits the specified configured task awaitable and returns its result, throwing any exception produced by the operation. |
| Await<T>(ConfiguredValueTaskAwaitable<T>) |
Awaits the specified configured value task awaitable and returns its result, throwing any exception produced by the operation. |
| Await<T>(Task<T>) |
Awaits the specified Task<TResult> and returns its result, throwing any exception produced by the task. |
| Await<T>(ValueTask<T>) |
Awaits the specified ValueTask<TResult> and returns its result, throwing any exception produced by the operation. |
Await(ConfiguredTaskAwaitable)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified configured task awaitable and throws any exception produced by the operation.
public:
static void Await(System::Runtime::CompilerServices::ConfiguredTaskAwaitable configuredAwaitable);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static void Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable);
public static void Await(System.Runtime.CompilerServices.ConfiguredTaskAwaitable configuredAwaitable);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Runtime.CompilerServices.ConfiguredTaskAwaitable -> unit
static member Await : System.Runtime.CompilerServices.ConfiguredTaskAwaitable -> unit
Public Shared Sub Await (configuredAwaitable As ConfiguredTaskAwaitable)
Parameters
- configuredAwaitable
- ConfiguredTaskAwaitable
The configured awaitable to await.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.
Applies to
Await(ConfiguredValueTaskAwaitable)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified configured value task awaitable and throws any exception produced by the operation.
public:
static void Await(System::Runtime::CompilerServices::ConfiguredValueTaskAwaitable configuredAwaitable);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static void Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable);
public static void Await(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable configuredAwaitable);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable -> unit
static member Await : System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable -> unit
Public Shared Sub Await (configuredAwaitable As ConfiguredValueTaskAwaitable)
Parameters
- configuredAwaitable
- ConfiguredValueTaskAwaitable
The configured value task awaitable to await.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.
Applies to
Await(Task)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified Task and throws any exception produced by the operation.
public:
static void Await(System::Threading::Tasks::Task ^ task);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static void Await(System.Threading.Tasks.Task task);
public static void Await(System.Threading.Tasks.Task task);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Threading.Tasks.Task -> unit
static member Await : System.Threading.Tasks.Task -> unit
Public Shared Sub Await (task As Task)
Parameters
- task
- Task
The task to await.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.
Applies to
Await(ValueTask)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified ValueTask and throws any exception produced by the operation.
public:
static void Await(System::Threading::Tasks::ValueTask task);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static void Await(System.Threading.Tasks.ValueTask task);
public static void Await(System.Threading.Tasks.ValueTask task);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Threading.Tasks.ValueTask -> unit
static member Await : System.Threading.Tasks.ValueTask -> unit
Public Shared Sub Await (task As ValueTask)
Parameters
- task
- ValueTask
The value task to await.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.
Applies to
Await<T>(ConfiguredTaskAwaitable<T>)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified configured task awaitable and returns its result, throwing any exception produced by the operation.
public:
generic <typename T>
static T Await(System::Runtime::CompilerServices::ConfiguredTaskAwaitable<T> configuredAwaitable);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static T Await<T>(System.Runtime.CompilerServices.ConfiguredTaskAwaitable<T> configuredAwaitable);
public static T Await<T>(System.Runtime.CompilerServices.ConfiguredTaskAwaitable<T> configuredAwaitable);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Runtime.CompilerServices.ConfiguredTaskAwaitable<'T> -> 'T
static member Await : System.Runtime.CompilerServices.ConfiguredTaskAwaitable<'T> -> 'T
Public Shared Function Await(Of T) (configuredAwaitable As ConfiguredTaskAwaitable(Of T)) As T
Type Parameters
- T
The result type produced by the awaitable.
Parameters
- configuredAwaitable
- ConfiguredTaskAwaitable<T>
The configured awaitable to await.
Returns
The result of the awaitable.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.
Applies to
Await<T>(ConfiguredValueTaskAwaitable<T>)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified configured value task awaitable and returns its result, throwing any exception produced by the operation.
public:
generic <typename T>
static T Await(System::Runtime::CompilerServices::ConfiguredValueTaskAwaitable<T> configuredAwaitable);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static T Await<T>(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<T> configuredAwaitable);
public static T Await<T>(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<T> configuredAwaitable);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<'T> -> 'T
static member Await : System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<'T> -> 'T
Public Shared Function Await(Of T) (configuredAwaitable As ConfiguredValueTaskAwaitable(Of T)) As T
Type Parameters
- T
The result type produced by the awaitable.
Parameters
- configuredAwaitable
- ConfiguredValueTaskAwaitable<T>
The configured awaitable to await.
Returns
The result of the awaitable.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.
Applies to
Await<T>(Task<T>)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified Task<TResult> and returns its result, throwing any exception produced by the task.
public:
generic <typename T>
static T Await(System::Threading::Tasks::Task<T> ^ task);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static T Await<T>(System.Threading.Tasks.Task<T> task);
public static T Await<T>(System.Threading.Tasks.Task<T> task);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Threading.Tasks.Task<'T> -> 'T
static member Await : System.Threading.Tasks.Task<'T> -> 'T
Public Shared Function Await(Of T) (task As Task(Of T)) As T
Type Parameters
- T
The result type produced by the task.
Parameters
- task
- Task<T>
The task to await.
Returns
The result of the task.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.
Applies to
Await<T>(ValueTask<T>)
- Source:
- AsyncHelpers.cs
- Source:
- AsyncHelpers.cs
Note
To use this preview API, you must enable preview features in your project by setting the EnablePreviewFeatures property to True in your project file. For more information, see https://aka.ms/dotnet-preview-features.
Awaits the specified ValueTask<TResult> and returns its result, throwing any exception produced by the operation.
public:
generic <typename T>
static T Await(System::Threading::Tasks::ValueTask<T> task);
[System.Runtime.Versioning.RequiresPreviewFeatures]
public static T Await<T>(System.Threading.Tasks.ValueTask<T> task);
public static T Await<T>(System.Threading.Tasks.ValueTask<T> task);
[<System.Runtime.Versioning.RequiresPreviewFeatures>]
static member Await : System.Threading.Tasks.ValueTask<'T> -> 'T
static member Await : System.Threading.Tasks.ValueTask<'T> -> 'T
Public Shared Function Await(Of T) (task As ValueTask(Of T)) As T
Type Parameters
- T
The result type produced by the value task.
Parameters
- task
- ValueTask<T>
The value task to await.
Returns
The result of the value task.
- Attributes
Remarks
This member supports .NET infrastructure and is not intended to be used directly from your code.