System.Threading.Task is one of the de facto best practices for .net programming for async programming for all these years. C# 7.0 has added a cherry on top of it with Value Task for optimizing performance and abstraction.

Performance benefit

To illustrate the benefit in performance, Let’s call an API to return the restaurant data for a particular city and cache the result. I have used caching here to show that there is a mix of synchronous and asynchronous code.

Abstraction

One of the problems with using Task in the abstraction is we will force the implementation to use the asynchronous code where it may not be required.

I build intelligent Web Apps