title: Why does overridden auto-implemented property in derived class have a different value from virtual base class property in C#
body: <p>I have a 'base' that has a <code>virtual int</code> auto implemented property called 'id'. </p>
  
  <pre><code>class bbase
  {
      public virtual int id { get; set; }
  
  }
  </code></pre>
  
  <p>When I inherit from this class to a 'derived' class, I get:</p>
  
  <pre><code>class Derived : bbase
  {
      public override int id
      {
          get
          {
              return base.id;
          }
          set
          {
              base.id = value;
          }
      }
  }
  </code></pre>
  
  <p>After initializing the base and derived classes and assigning the value to base class property like this:</p>
  
  <pre><code>bbase b2 = new bbase();
  Derived d2 = new Derived();
  b2.id = 6;
  </code></pre>
  
  <p>When I try to output the value from derived class it outputs '0':</p>
  
  <pre><code>Console.WriteLine(d2.id);
  </code></pre>
  
  <p>My confusion is when I try the same approach with virtual methods it works fine. The derived class method with <code>base.method()</code> works fine. It returns whatever is there in the base method but why not with auto-implemented properties?</p>
  
  <pre><code>class bbase 
  {
      public virtual void execute() { Console.WriteLine("base.execute2"); }
  }
  
  class Derived : bbase
  {
       public override void execute()
       {
           base.execute();
       }
  }
  </code></pre>