Entity Framework: There is already an open DataReader associated with this Command
Posted in Entity FrameworkWhen using Entity Framework I sometimes got the following error:
EntityCommandExecutionException
{"There is already an open DataReader associated with this Command which must be closed first."} at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands...
The solution I found involved converting the IQueriable collection into other enumerable collection e.g.
_dbContext.Users.ToList()