Re[3]: .NET 5.0, EF6, DependencyInjection и асинхронный WebAPI
От: B7_Ruslan  
Дата: 17.09.20 05:10
Оценка:
Здравствуйте, Yuri Abele, Вы писали:

YA>var entityOne = this.DbContext.EntiesOne.SingleAsync(e1 => e1 == 123);

YA>var entitiesTwo = this.DbContext.EntiesTwo.Where(e2 => e2.Abcd == entityOne.Abcd).ToListAsync();

У вас именно так написано или все таки стоит await:

var entityOne = await this.DbContext.EntiesOne.SingleAsync(e1 => e1 == 123);
var entitiesTwo = await this.DbContext.EntiesTwo.Where(e2 => e2.Abcd == entityOne.Abcd).ToListAsync();

Из справки:
Remarks
Multiple active operations on the same context instance are not supported. Use 'await' to ensure
that any asynchronous operations have completed before calling another method on this context.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.