I have an object I pass to a WCF service. Then on the server, the service modifies some properties of the object, and returns an int.
On the client side, after the service is called, the changes made to the objects’ properties are not there.
My unit tests work fine. But when run over services, the problem occurs.
Any ideas on how to fix this?
When you pass something over the service boundary it’s being passed by value not by reference so any changes made on the server will not propagate to the object you passed from the client. So you would want to return the modified object back to the client. If you also need to return the int you can create a wrapper class that can contain both the int and the changed object.