title: [WCF][IsReference=true] Compare objects of the same instance
body: <p>I'm developing a WCF Service and using Entity Framework (EF) to model my database into objects.</p>
  
  <p>I've also built my own objects to extend the EF objects, in order to provide custom features and not be "hostage" of any update to the EF model.</p>
  
  <p>So, the thing is, imagine two childs with the same parent (that is, the parent have the same Id but are not the same object in the memory). When I see the generated SOAP message It's not using the IsReference property because WCF cannot realize that the objects should be the same.</p>
  
  <p>I've tried to override Equals an ReferenceEquals but no luck what so ever.</p>
  
  <p>Any suggestion?</p>
  
  <p>Best regards,
  jpsfs</p>
  
  <p>Example:</p>
  
  <pre><code>    [DataContract(Name = "Parent", IsReference = true)]
      public sealed class Parent 
      {
  
          [DataMember(Name = "Id")]
          public int Id
          {
              get;
              set;
          }
       }
  
      [DataContract(Name = "Child")]
      public sealed class Child 
      {
  
          [DataMember(Name = "Id")]
          public int Id
          {
              get;
              set;
          }
          [DataMember(Name = "Parent")]
          public Parent Parent{
              get;
              set;
          }
  
       }
  </code></pre>