Collection was modified; enumeration operation may not execute

Collection was modified; enumeration operation may not execute

Postby ricsmania » Wed 29 Jun 2016 16:11

Hello,

I'm getting this error when trying to read records concurrently and using Include to get the children:

Collection was modified; enumeration operation may not execute

The line that throws the error is this:

Code: Select all
return Ok(_context.Blogs.Include(blog => blog.Posts).FirstOrDefault(blog => blog.Id == id));


There doesn't seem to be anything wrong with the code, so it might be a bug.

dotConnect version 9.1.45.

Full explanation and code samples here: http://stackoverflow.com/questions/38101571/dotconnect-with-entityframework-core-returns-collection-was-modified-enumeratio

Thanks.
ricsmania
 
Posts: 9
Joined: Fri 17 Jun 2016 16:37

Re: Collection was modified; enumeration operation may not execute

Postby Shalex » Thu 07 Jul 2016 16:02

Entity Framework Core 1.0 RTM is supported in the newest (9.1.55) build of dotConnect for Oracle: https://www.devart.com/dotconnect/oracle/revision_history.html. Please try it and upgrade your project to Core 1.0 RTM. Does this help?
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Re: Collection was modified; enumeration operation may not execute

Postby ricsmania » Wed 13 Jul 2016 11:12

Hello Shalex,

I tried the 9.1.55 version with EF 1.0 but got the same error.

It is pretty easy to reproduce:

Create a Nuget from DotConnect 9.1.55 with the name Devart.Data.Oracle and version 9.1.55 and add the source to VS
Clone https://github.com/ricsmania/BlogsOracleEntityFramework
Run the script src/BlogOracle/Database/Blogs.sql
Change the BlogOracle model with the correct connect string
Run BlogOracle
Run SendRequests
ricsmania
 
Posts: 9
Joined: Fri 17 Jun 2016 16:37

Re: Collection was modified; enumeration operation may not execute

Postby Shalex » Fri 15 Jul 2016 17:35

Thank you for your report. We will investigate the issue and notify you about the result.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Re: Collection was modified; enumeration operation may not execute

Postby Shalex » Fri 09 Sep 2016 17:13

Your project is configured to use .NET Core SDK version 1.0.0-preview1-002702. Please upgrade it to the release version and try the newest (9.1.97) build of dotConnect for Oracle.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle