Hi everyone. I'm learning EF Core 8 and encountered some issues with pagination in the following code.
using Dashboard.Data;
using Dashboard.Dat...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
Okay, I've found a solution. I can use IDbContextFactory.
learn.microsoft.com/en-us/ef/core/...
Register in DI
Using
Did this fit your exact use case?
You can't use
await Task.WhenAll(), do this:var totalItems = await queryable.CountAsync(cancellationToken);var result = await queryable.Take(query.Limit).ToListAsync(cancellationToken);return PaginationResult<Advertiser>.From(result, totalItems, query);Got it. Is there a way to run it independently? My dataset is quite large, so running queries sequentially is slow.
If you have a high load on your server, start implementing caching: github.com/VahidN/EFCoreSecondLeve...
Hi, Atmosphere ,
Thanks for sharing