In the non working code, you sort, take the first page size entries, then perform a where on this subset. In the working code, you filter from the whole set, than sort and take.
will be error when I using ToListAsync?
mc
4,111
Reputation points
now I am testing the .net maui android and using sqlite. when I read data in sqlite and click the button quickly. _context.Products.AsNoTracking().OrderByDescending(x => x.Id).Skip(0).Take(pageSize).Where(x => ids.Contains(x.ProductTypeId)).ToListAsync(); it may return Count = 0 but it is wrong and I change it to
await (from p in _context.Products.AsNoTracking()
join i in ids
on p.ProductTypeId equals i
select p).OrderByDescending(x => x.Id).Skip(0).Take(pageSize).ToListAsync();
no matter how fast I click it the result is right. why?