title: Partially Overriding a Virtual Auto-Property in a Child Class
body: <p>Time for a theoretical question I just ran across.</p>
  
  <p>The following code is valid and compiles:</p>
  
  <pre><code>public class Parent
  {
      public virtual object TestProperty { get; set; }
  }
  
  public class Child : Parent
  {
      private string _testValue = "Hello World!";
  
      public override object TestProperty
      {
          get { return _testValue; }
      }
  }
  
  public class Consumer
  {
      Parent p = new Child();
  
      public Consumer(){ p.TestProperty = 3; }
  }
  </code></pre>
  
  <p>My question is: </p>
  
  <p><strong>Why does C# allow me to partially override the <code>TestProperty</code> auto property in a child when it leads to partially unpredictable behavior?</strong> Is there a practical application?</p>
  
  <p>I'm allowed to set the value of TestProperty using the parent's setter (I checked the IL being generated and the setter is still setting the backing object in the parent class) even though value is not accessible to the public.</p>