|
Ok, the title isn't quite right...hopefully it doesn't mislead too much.
I can reproduce this problem 100% in our application but I cannot explain it at all and I am not going to be able to provide a ton of detail on it, BUT here it is:
I have seen this occur on two seperate models. I have not tracked down the simliarities, at first glance there are none.
I have an entity (Deal) which had a foreign key property (Location) which if changed it would save the information just fine. When the entity came back from the save it would show Deal.Location as the proper Entity, but Deal.LocationId would be 0. I had seen this awhile back related to an ImportEntities bug...but I am seeing this before doing anything with the entity, this is in the SaveCallback, the args.Entities. So the data saves correctly, the related property shows correctly, but the LocationId (foreign key to Location) was 0. This effects my UI and shows as an emtpy location. After looking everywhere I could think of I randomly commented out my verifiers...and it started working correctly. None of the verifiers have anything do to with Location or LocationId. So I started putting them back in one by one and there was one specifically that would trigger ther problem...so I left it commented out. There are no errors, client or server side (that I have seen). The verifier in question never returned anything but Ok.
So now on another model the entity (Confirmation) has a foreign key property (ReceiveMethod) that showed the same symptoms. I went straight to the verifiers, only one on this model, and commented it out and it started working. The verifier has nothing to do with the property. The save works fine, but the entity when returned in args.Entities is showing the Confirmation.ReceiveMethod correctly but the Confirmation.ReceiveMethodId is 0. Before the save the Id's were correct. After removing the verifiers the Id's showed up correctly.
Thats all I know. Luckily we were already wanting to eliminate most of our verifiers as they didn't belong in the model so its not a show stopper (for us) but that seems to be a very strange behavior.
|