You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a context, a database, and models. Then make a difference between the database and the EF Core model. Then run any code to read from the database:
using var context = new SomeContext();
var items = context.SomeItem.ToList();
You end up with an exception like this:
fail: 08/14/2024 07:29:05.687 CoreEventId.QueryIterationFailed[10100] (Microsoft.EntityFrameworkCore.Query)
An exception occurred while iterating over the results of a query for context type 'SomeContext'.
No matter where I put try/catch blocks, I can't catch this message. It seems that this message is internal to the EF Core and it catches it internally, logs it, and then rethrows it.
I need to be able to extract the context name from this message. Either report back the name of the context, or somehow let us catch this exception.
File a bug
Include your code
Create a context, a database, and models. Then make a difference between the database and the EF Core model. Then run any code to read from the database:
You end up with an exception like this:
No matter where I put try/catch blocks, I can't catch this message. It seems that this message is internal to the EF Core and it catches it internally, logs it, and then rethrows it.
I need to be able to extract the context name from this message. Either report back the name of the context, or somehow let us catch this exception.
Include provider and version information
EF Core version: 8.0.2
Database provider: Pomelo.EntityFrameworkCore.MySql
Target framework: net8.0
Operating system: Debian GNU/Linux 12 (bookworm)
I have also reported it to the EF Core team dotnet/efcore#34430
The text was updated successfully, but these errors were encountered: