Is there a way I can run a Database.SqlQuery as async?

前端 未结 1 1141
無奈伤痛
無奈伤痛 2020-12-10 23:57

I have the following:

var sql = @\"Select 
                case when Test.TestTypeId = 1 then Exam.Name
                     when Test.TestTypeId = 2 then To         


        
1条回答
  •  一整个雨季
    2020-12-11 00:51

    If you're using Entity Framework 6 you just need to specify

    using System.Data.Entity;
    

    at the top of your file.

    ToListAsync is an extension method on IQueryable declared in System.Data.Entity.QueryableExtensions

    0 讨论(0)
提交回复
热议问题