使用EntityFramework Core,以下代码在 var details 行中陷入死锁,但是如果我在 var ratingTask 行上使用SumAysnc()扩展方法等待或使用其他异步扩展方法(例如ToArrayAsync()ToListAsync())然后代码完美地工作,这是SumAsync()的问题还是我做错了?
var ratingTask = (from f in Db.Table<Feedback>()
where f.StoreId== storeId && f.IsDeleted
select f.OverallRate).SumAsync();
var details = await (from s in Db.Table<Store>()
join a in Db.Table<Address>()
on s.AddressId equals a.Id
where !s.IsDeleted
select new StoreViewModel
{
s.Id,
s.Name,
s.IsActive,
a.StreetName,
a.RegionName,
}).FirstOrDefaultAysnc();
details.Rating = await ratingTask;
我在.Net Framework 4.7类库中使用Ef-Core版本2.0.1