AsyncHelperFromResultTResult(TResult, TaskConfig) Method
Returns a task that represents an already completed operation with a result.
See the
Examples section of the
AsyncHelper class for details.
Namespace: KGySoft.ThreadingAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static Task<TResult> FromResult<TResult>(
TResult result,
TaskConfig? asyncConfig
)
Public Shared Function FromResult(Of TResult) (
result As TResult,
asyncConfig As TaskConfig
) As Task(Of TResult)
public:
generic<typename TResult>
static Task<TResult>^ FromResult(
TResult result,
TaskConfig^ asyncConfig
)
static member FromResult :
result : 'TResult *
asyncConfig : TaskConfig -> Task<'TResult>
- result TResult
- The result to be returned by the returned task if the operation has not been canceled.
- asyncConfig TaskConfig
- The configuration for the asynchronous operation.
- TResult
- The type of the result.
TaskTResultA
TaskTResult that represents the completed operation. Its result is
result if the operation has not been canceled,
or the default value of
TResult if the operation has been canceled
and
ThrowIfCanceled in
asyncConfig was set to
.