ValueTask.FromException Method
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.
FromException(Exception) |
Creates a ValueTask that has completed with the specified exception. |
FromException<TResult>(Exception) |
Creates a ValueTask<TResult> that has completed with the specified exception. |
- Source:
- ValueTask.cs
- Source:
- ValueTask.cs
- Source:
- ValueTask.cs
Creates a ValueTask that has completed with the specified exception.
public:
static System::Threading::Tasks::ValueTask FromException(Exception ^ exception);
public static System.Threading.Tasks.ValueTask FromException(Exception exception);
static member FromException : Exception -> System.Threading.Tasks.ValueTask
Public Shared Function FromException (exception As Exception) As ValueTask
Parameters
- exception
- Exception
The exception with which to complete the task.
Returns
The faulted task.
Applies to
.NET 10 dan versi lain
Produk | Versi |
---|---|
.NET | 5, 6, 7, 8, 9, 10 |
- Source:
- ValueTask.cs
- Source:
- ValueTask.cs
- Source:
- ValueTask.cs
Creates a ValueTask<TResult> that has completed with the specified exception.
public:
generic <typename TResult>
static System::Threading::Tasks::ValueTask<TResult> FromException(Exception ^ exception);
public static System.Threading.Tasks.ValueTask<TResult> FromException<TResult>(Exception exception);
static member FromException : Exception -> System.Threading.Tasks.ValueTask<'Result>
Public Shared Function FromException(Of TResult) (exception As Exception) As ValueTask(Of TResult)
Type Parameters
- TResult
The type of the result of the returned task.
Parameters
- exception
- Exception
The exception with which to complete the task.
Returns
The faulted task.
Applies to
.NET 10 dan versi lain
Produk | Versi |
---|---|
.NET | 5, 6, 7, 8, 9, 10 |
.NET maklum balas
.NET ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas: