-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove EF warning logs 'The query uses a row limiting operator' #7188
Comments
Thanks, I will check it out. |
I've just done some testing and Thanks for looking 👍 |
I posted this issue with the same topic. It was closed, but it would be nice to see why. |
hi @davidzwa We plan to enhance GetAsync to eliminate EF warnings |
Sorry @davidzwa I missed that issue! This change should fix the issue when getting a single record from the database via the Lines 123 to 131 in 3789b0d
|
If I understand correctly the best advice is to not use IRepository<TEntity, TKey> directly and fix the OrderBy on application level? So far I was using the repo for seeding. I can wait for the preview, np ;) |
You can override most functionality in the system simply by inheriting the class you want to override, then using |
Since .NET 5, Microsoft has un-obsoleted the CoreEventId.FirstWithoutOrderByAndFilterWarning and CoreEventId.RowLimitingOperationWithoutOrderByWarning
I get warning logs like this when using methods like the default
IReadOnlyAppService.GetAsync
method and queries withNote: The log above appears for FirstOrDefault() calls as well as ToList() even though the
CoreEventId.FirstWithoutOrderByAndFilterWarning
warning should be written. I'm not sure why this happens but its probably a bug with EF.Is there a way to apply something like the
AbstractKeyReadOnlyAppService.ApplyDefaultSorting
method to the EfCoreRepository for FindAsync calls (and default back to sorting by Entity.Id if CreationTime doesn't exist) or change it toSingleOrDefaultAsync
?abp/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs
Line 412 in 158158e
The text was updated successfully, but these errors were encountered: