Hi, We have a long entity framework context running (don't ask why...), with a query which retrieves a user entity with its associations:
var user = entities.UserSet.Include("UserAddresses")
.Where(u => u.Id == 1).FirstOrDefault();
If a row of a user address is deleted from the database (by another process), and we run this query again, we still get the deleted row, even if we're setting the MergeOption before the call (in order to go the database in any case and not use the cache):
(Tried any set I have in the query, with no success)
entities.UserSet.MergeOption = System.Data.Objects.MergeOption.OverwriteChanges;
entities.UserAddress.MergeOption = System.Data.Objects.MergeOption.OverwriteChanges;
entities.UserSet.Include("UserAddresses").MergeOption = System.Data.Objects.MergeOption.OverwriteChanges;
Can anyone help with this issue?
Thanks, Nir.