title: How do I override virtual method with parameter that inherits base method parameter?
body: <p>I have a set of objects inherited from <code>ObjBase</code> class. Processing logic is pretty same for all of these objects with a little differences. How do I keep all logic in <code>public virtual void Work(ObjBase o)</code> and process specific logic in overridden methods. </p>
  
  <p>Example below is something I want to achieve, but it can't compile because of overriding parameters. </p>
  
  <p>What be the better way to implement that ?</p>
  
  <pre><code>class Foo
  {
      public void Do(ObjBase o)
      {
          switch (o.RequestType)
          { 
              case "A":
                  new ProcA&lt;ObjA&gt;().Work(o);
                  break;
              case "B":
                  new ProcB&lt;ObjB&gt;().Work(o);
                  break;
          }
      }
  }
  
  class ObjBase { }
  class ObjA : ObjBase { }
  class ObjB : ObjBase { }
  
  class ProcBase
  {
      public virtual void Work(ObjBase o)
      {
          //Common things to do...
      }
  }
  
  class ProcA&lt;T&gt; : ProcBase where T : ObjBase
  {
      public override void Work(ObjA o)
      {
          base.Work(o);
          //DoSpecificWork
      }
  }
  
  class ProcB&lt;T&gt; : ProcBase where T : ObjBase
  {
      public override void Work(ObjB o)
      {
          base.Work(o);
          //DoSpecificWork
      }
  }
  </code></pre>
  
  <p>Thank you</p>