Passing object through WCF so that server receives client changes
- by cvig
I would like to set up a WCF service so that any changes a client makes to an object I send them are also reflected on the server side. For example, if Assembly A has the following...
namespace AssemblyA
{
    public class Person
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
    [ServiceContract]
    public interface IServer
    {
        [OperationContract]
        Person GetPerson();
    }
}
And Assembly B references Assembly A...
using AssemblyA;
namespace AssemblyB
{
    class Program
    {
        static void Main(string[] args)
        {
            <snip>
            IServer server = factory.CreateChannel();
            Person person = server.GetPerson();
            person.FirstName = "Kilroy";
            person.LastName = "WuzHere";
        }
    }
}
What is the easiest/best way to make it so that the service's copy of the Person object also reflects the changes that the client makes? Is this even possible?