I have a process that is processing a list of coordinates. It does this in batches. Let say it's processing 100 coordinates in batches of 10. So I have a foreach loop over with my 100 coordinates and every 10th I do a SaveChanges().
Within the loop I'm checking to see if the coordinate is a duplicate. If so, I mark it as deleted by setting a flag.
If it's not a duplicate I'm searching for the previous coordinate (in time) that is not deleted.
Now the unexpected part of my case: often times the coordinate I get back from this method has it's deleted flag to true!
If I, after setting the deleted flag, do a SaveChanges(), I get a different result.
Who can explain this difference in behaviour? Is this a bug or by design?
.net framework 4.5