An exception occurred while iterating over the results of a query for context type EF core

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

I am getting the exact exception in the title of your video, but I don't think it is the same error you described. The reason I say that the error does not occur while iterating through the first rows of data. I am using keyset pagination, and initially I tried page size of 200 records. What I found was that the code worked fine on the first page, but trying to iterate the second page would generate the above exception. If there was an invalid column name in the SQL Query generated by EF Core 8, then clearly the error would happen sooner, correct? Meaning, while processing the first row.

I do have quite a complex query being generated due to having quite a few Include() calls, but I looked over the SQL statement and ran it myself and it executed in about 23 seconds without errors.

johnnyvlee