dotnet-daily-tips

057 - Task methods

Apart from WhenAll, used in on the previous day, Task has also some other static methods that can be useful if we have more than one task to run.

Good to know they exists and use them when needed.

// Task has few methods that can be useful in certain situations
Task.WhenAll();

Task.WhenAny();

Task.WaitAll();

Task.WaitAny();

Task.FromResult<T>();

Task.FromException<T>();

Task.FromCancelled<T>();