Collection was modified. Enumeration operation may not execute.
Code:
Error:
It seems that the error is being triggered because database is being updated while iterating over the collection of entities in the database or is it happening only because properties of collection are being changed while inside the for loop or because of _db.Folders.Remove(...) ?
Also how can I fix it because at the end of the day I want to modify the collection and delete the rows I wanna delete? I got an idea but I think forgot it
Error:
It seems that the error is being triggered because database is being updated while iterating over the collection of entities in the database or is it happening only because properties of collection are being changed while inside the for loop or because of _db.Folders.Remove(...) ?
Also how can I fix it because at the end of the day I want to modify the collection and delete the rows I wanna delete? I got an idea but I think forgot it