Q:

DELETE via linq throwing concurrency exception without concurrency

Via linq while using entity framework, I'm removing data from a mysql db, it's a single thread program and nobody is working on db isntead of me.  Every time that i try to remove entities via:
db.table. Remove(entity);

It throws a concurrency exception when i do db. SaveChanges(); how is it possible? 

A:

I didn't find this problem on StackOverflow so I will post the solution because i found it by myself and the error wont lead you to a solution:
If you must do operations in a foreach, using a list of results took by your DB, and then you have to remove results
Don't do that:
List<Ducks> ducks = (from duck in db. Ducks select duck).ToList();
foreach (Ducks duck in ducks)
{
    //TODO
    db. Ducks. Remove(duck);
}
db. SaveChanges();

Or you will get into concurrency errors. 
You must remove entities out of their foreach. 
Solution:
List<Ducks> ducks = (from duck in db. Ducks select duck).ToList();
foreach (Ducks duck in ducks)
{
    //TODO
}
db. Ducks. RemoveRange(ducks);
db. SaveChanges();

