title: Method Override with some condition in Console application
body: <p>I am creating one console application. I have one class in which I wrote some methods. Now I want to override some methods of that class in a different class. But this should be override only if condition satisfied.</p>
  
  <p>For example,</p>
  
  <pre><code>public partial Class MainClass
  {
     public string GetPath()
     {
        string temp =  Method1();
        return temp;
     }
  
      protected virtual string Method1()
      {
         //logic
      }
  
  
  }
  </code></pre>
  
  <p>If some condition satisfied then only overridden method should be called</p>
  
  <pre><code>public partial class ChildClass : MainCLass
  {
      public override void Method1()
      {
          //MY Logic
      }
  }
  </code></pre>
  
  <p>How can I achieve this? Is it possible to do so?</p>