I have the following repository method:-
public IQueryable<TSet> getAllScanEmailTo()
{
return t.TSets.Where(a=>a.Name.StartsWith("ScanEmail"));
}
which is being called as follow:-
var emailsTo = repository.getAllScanEmailTo().ToList();
now i tried to change the above to be using async so i modifed my repository method to be as follow:-
public async Task< IQueryable<TSet>> getAllScanEmailTo()
{
return await t.TSets.Where(a=>a.Name.StartsWith("ScanEmail"));
}
but i got the following error :-
Error 1 Cannot await 'System.Linq.IQueryable<Final.Models.TSet>'
Since you mentioned you are using EF6, you can use .ToListAsync()
. Then you can await
on that.