I want to create a completed Task (not Task<T>). Is there something built into .NET to do this?
Task
Task<T>
A related question: Create a completed Task<T>
The newest version of .Net (v4.6) is adding just that, a built-in Task.CompletedTask:
Task completedTask = Task.CompletedTask;
That property is implemented as a no-lock singleton so you would almost always be using the same completed task.
1.4m articles
1.4m replys
5 comments
56.9k users