Is it correct if i am using await + ToListAsync() over IQueryable which is not defined as a task

后端 未结 3 2013
忘了有多久
忘了有多久 2020-12-10 13:01

I am using asp.net MVC-5 with EF-6, and I am not sure if using await + ToListAsync is valid. For example, I have the following repository method which returns a

3条回答
  •  粉色の甜心
    2020-12-10 13:36

    Actually there is no problem because you are awating the ToListAsync() not the getAllScanEmailTo().

    EDIT: To see how async-await pattern is working you can see this link. Here is a usefull image from there

提交回复
热议问题