var interviewTasks = new List<Task<Interview>>();
foreach (var interview in interviews)
var interviewTask = _context.InterviewRepository.GetIncludingByName(
e => e.InterviewId == interview.InterviewId,
foreach (var interviewTask in interviewTasks)
var interview = interviewTask.Result;
var categories = interview.InterviewCategories
.Select(e => e.Category)
.Select(e => e.Name)
interviews.Find(e => e.InterviewId == interview.InterviewId).Categories = categories;
The exception happens at "await Task.WhenAll".
According to the exception message, I need to call await on each task sequentially. What is the point of having a SingleAsync method if you can't call them concurrently?
A second operation started on this context before a previous asynchronous operation completed. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context. Any instance members are not guaranteed
to be thread safe.
What am I missing?