title: C# Serialization and properties
body: <p>I have a kind of foreignkey implementation, so that my class has a field that is a reference to another object, and then it has a property that fetches the other object on demand:</p>
  
  <pre><code>[Serializable]
  public class MyClass {
      private string otherId;
      public SomeClass Other {
          get { return SomeClass.GetById(otherId); }
          set { otherId = value.id; }
      }
  }
  </code></pre>
  
  <p>Now, can anyone please explain what happens when I serialize/deserialize this class using C# default serialization (I'd like to understand both binary and XML serialization please)</p>