Reputation: 21108
I have added properties to client side entity that is generated by the Ria Services tooling. I'm doing this by creating a new file containing a partial class definition.
Through the UI, some changes are made to various properties of an instance of this class. The problem comes when I call the DomainContext SubmitChanges().
It seems that the changed object is sent to the server (that's good) but then it seems that something else must be happening because my object's client side properties are being reset.
How should I preserve the local data such that it survives from one SubmitChanges to the next.
Upvotes: 0
Views: 219
Reputation: 270
This is a known problem with WCF RIA Services. You would get the same problem if you ever try to refresh the entity with a new load. If null is not a valid value for your property in the setter of the property check to see if the value is null and if it is then ignore the set.
If your property is an integer change it to an int? so that you can get a null back instead of a 0.
Upvotes: 1
Reputation: 1433
I guess you see this behavior (the reset of the client side object properties) after the Submitchange's response. This is normal and I wouldn't change it.
With fiddler and the wcf binary inspector take a look at the response: the server update the state of the client-side object's after the submitchange's call.
Do the updated object looks empty ?
Upvotes: 0