title: How to use delegates/ generics in this case?
body: <p>I have 2 enums enum1, enum2.</p>
  
  <p>I have two functions :</p>
  
  <pre><code>bool func1(int param1 , enum1 type)
  bool func1(int param1 , enum2 type)
  </code></pre>
  
  <p>Both functions have exactly similar structure. Only difference in all conditions is: func1 has enum1.str1 is used in all comparisons and func2 has enum2.str2 is used in all comparisons</p>
  
  <p>Since both functions are similar, I want to combine the two.. What is the best way to do it?</p>
  
  <pre><code>func1(int param1, enum1 type)
  {
  
        if (type.Equals(enum1.abc))
        {
          // do something
        }
        else if(type.Equals(enum1.def))
        {
      // do something
        }
  
  }
  
  
  func2(int param1, enum2 type)
  {
  
        if (type.Equals(enum2.abcd))
        {
          // do something
        }
        else if(type.Equals(enum2.defg))
        {
      // do something
        }
  
  }
  </code></pre>