C
C#ā€¢2y ago
Sernik

Await Linq Expression

Where can I await this to convert IEnumerable<Task<EmployeeView>> to IEnumerable<Employee>?
8 Replies
Sernik
Sernikā€¢2y ago
this is not working
Sernik
Sernikā€¢2y ago
Sernik
Sernikā€¢2y ago
and this is also not working
Sernik
Sernikā€¢2y ago
canton7
canton7ā€¢2y ago
await Task.WhenAll(employees.Select(async x => new ....))
Sernik
Sernikā€¢2y ago
Thanks!
Jayy
Jayyā€¢2y ago
This is a horribly inefficient way to do that i think, depending on ur schema
canton7
canton7ā€¢2y ago
Forget N+1, this is more like 3N+1? šŸ˜›