Reputation: 4692
I'm using Entity Framework 6.1 and am getting the above subject line error. The design time compile error is on the second line starting with the await.
How come I cannot await the SqlQuery? If I remove the await, the clause is fine.
I have the below code snippets:
public async Task<IEnumerable<HH_FuelTkt_Output>> GetFilteredFuelTicketsAsync(HH_FuelTkt_Input value)
var fto = await DbContext.HH_FuelTkt.SqlQuery("SELECT * from HH");
Upvotes: 0
Views: 487
Reputation: 27012
SqlQuery()
doesn't return a Task
, so you can't await it.
SqlQuery.ToListAsync()
, however, does return a Task
and can be awaited.
Upvotes: 1