I have a database and I make a lot of Where
calls to it to make a table in Blazor. This takes long because Where
is not Async. To speed this up I wanted to change the Where
statements by using: ToAsyncEnumerable().WhereAwait
from System.Linq.Async.
This is my line of code:
series5 = _context.ChickenSeries.ToAsyncEnumerable().WhereAwait(async serie => await ((serie.DatumWeek5 >= firstDay && serie.DatumWeek5 <= lastDay) && serie.SlaughterHouse.SlaughterHouseId != LeegstandID));
The error presenting on this line: 'bool' does not contain a definition for 'GetAwaiter' ...
How do I resolve this issue?
Original post where code is based on: How can I use "Where" with an async predicate? The last answer.