I am writing a .net Core 3.1 application and have recently updated it to Entity Framework Core 5.0. Running the application has since started showing warnings as follows:
The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results.
I have reviewed every instance of my code that would use .Skip or .Take or both and they all have a OrderBy clause.
My question is, are there any flags I can set with
DbContextOptiosnBuilder() .ConfigureWarnings(w => w.Throw(RelationalEventId.???))
to help determine where these .Skip and .Take queries are being ran or any way to trigger a stack trace with this warning to narrow down the cause.
Alternatively, how can one go about silencing this warning from the console?
OrderBy
before or after the Skip/Take?CoreEventId.RowLimitingOperationWithoutOrderByWarning