title: Convert derived class to base class
body: <p>I'm trying to refresh my memory but can't find answers with Google.</p>
  
  <pre><code>public class BaseClass
  {
      public virtual void DoSomething()
      {
          Trace.Write("base class");
      }
  }
  
  public class DerivedClass : BaseClass
  {
      public override void DoSomething()
      {
          Trace.Write("derived class");
      }
  }
  </code></pre>
  
  <p>If I create an instance of derived class, how do I convert it to it's base class so that when DoSomething() is called, it uses the base class's method only?</p>
  
  <p>A dynamic cast still calls the derived class's overridden method:</p>
  
  <pre><code>DerivedClass dc = new DerivedClass();
  
  dc.DoSomething();
  
  (dc as BaseClass).DoSomething();
  </code></pre>
  
  <p>Output: "derived class"</p>