That is not going to produce the error. You are not accessing anything asynchronously in that test.
The kind of navigation I am talking about is the same as what would happen between the Product.SupplierID relationship.
Try something like this:
mgr.ExecuteQueryAsync(mgr.Products).Completed+=(s,e)=>
{
e.Results.ToList().ForEach( p =>
{
p.Supplier.EntityAspect.PendingEntityResolved+=(sender,args)=>
{
if (p.EntityAspect.EntityState == EntityState.Unchanged)
{
MessageBox.Show("EntityState is Unchanged as expected");
}
else
{
MessageBox.Show("Something is wrong. EntityState is " + p.EntityAspect.EntityState.ToString());
}
};
});
};
The call to r.Supplier triggers devforce to fetch the supplier asynchronously, while handing a fake one to you. So far so good. Once the async fetch is complete however, the fake value is supposed to get a PropertyChangedEvent. Instead no event seems to occur and r.Supplier is marked as modified. Disaster!
Edited by pompomJuice - 13-Oct-2010 at 1:01am