How to convert IEnumerable<T> to List<T> after getting IEnumerable<T> from async function?
My code:
var orders = await _DbManager.Orders.GetAllAsync();
_DbManager.Orders.GetAllAsync() returns IEnumerable<Orders> and i want to avoid multiple-enumeration but _DbManager.Orders.GetAllAsync().ToList() gives me that error: Task<IEnumerable<Orders>> does not contain a definition for ToList....
What is the best solution to deal with this problem?
>Solution :
Try
var orders = (await _DbManager.Orders.GetAllAsync()).ToList();