Entity Framework Collection was modified; enumeration operation may not execute

You are seeing this because you delete objects from a collection that currently has active operations on. More specifically you are updating the Kids collection and then executing the Any() operator on it in the while loop. This is not a supported operation when working with IEnumerable instances. What I can advice you to do is rewrite your while as this:

parent.Kids.ToList().ForEach(r => context.Kids.DeleteObject(r));

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)