I have this query and I get the error in this function:
var accounts = from account in context.Accounts
from guranteer in account.Gurantors
In my case, I had to set the MultipleActiveResultSets
to True
in the connection string.
Then it appeared another error (the real one) about not being able to run 2 (SQL) commands at the same time over the same data context! (EF Core, Code first)
So the solution for me was to look for any other asynchronous command execution and turn them to synchronous, as I had just one DbContext for both commands.
I hope it helps you