c# - Is there a way I can run a Database.SqlQuery as async? -
i have following:
var sql = @"select case when test.testtypeid = 1 exam.name when test.testtypeid = 2 topic.name end name, test.title, test.testid, test.questionscount test left join exam on test.examid = exam.examid left join topic on test.topicid = topic.topicid test.teststatusid = 1 -- current"; var tests = db.database.sqlquery<testdto>(sql).tolist();
i looking async method not seem exist. there way can run async?
if you're using entity framework 6 need specify
using system.data.entity;
at top of file.
tolistasync
extension method on iqueryable<t>
declared in system.data.entity.queryableextensions
Comments
Post a Comment