Task.CompletedTask Property

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a task that has already completed successfully.

Namespace:   System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

public static Task CompletedTask { get; }

Property Value

Type: System.Threading.Tasks.Task

The successfully completed task.

This property returns a task whose Status property is set to TaskStatus.RanToCompletion. To create task that returns a value and runs to completion, call the FromResult<TResult> method.

Repeated attempts to retrieve this property value may not always return the same instance.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top