Прочитај на енглеском Уреди

Делите путем


TaskCompletionSource.TrySetResult Method

Definition

Attempts to transition the underlying Task into the RanToCompletion state.

C#
public bool TrySetResult();

Returns

true if the operation was successful; otherwise, false.

Remarks

This operation will return false if the Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled.

Applies to

Производ Верзије
.NET 5, 6, 7, 8, 9, 10