why i cannot await 'System.Linq.IQueryable

asynchronous c# entity-framework entity-framework-6 linq

Question

I use the repository technique listed below:

  public  IQueryable<TSet> getAllScanEmailTo()
        {
         return   t.TSets.Where(a=>a.Name.StartsWith("ScanEmail"));

        }

which is referred to as follows:

var emailsTo = repository.getAllScanEmailTo().ToList();

I then modified my repository method to be as follows in an attempt to convert the aforementioned to use async:

 public async Task<  IQueryable<TSet>> getAllScanEmailTo()
        {
         return  await t.TSets.Where(a=>a.Name.StartsWith("ScanEmail"));

        }

nonetheless, I get the following error:-

Error   1   Cannot await 'System.Linq.IQueryable<Final.Models.TSet>'
1
-4
9/22/2015 3:55:16 PM

Accepted Answer

ZZZ_tmp
7
9/22/2015 3:59:47 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow