title: Extension method for precisely two different types
body: <p>I'm using the code below. It's designed for a certain type to limit it's popup-ness in intellisense etc.</p>
  
  <pre><code>public static Generic Get&lt;Generic&gt;(this Entity input)
  {
    return (Generic)input;
  }
  </code></pre>
  
  <p>Now I'd like to use the same <em>Get</em> method for another type (or, to be fully covered, a few another types but still a fix number of). So I added a second method and the code looks as follows.</p>
  
  <pre><code>public static Generic Get&lt;Generic&gt;(this Entity input)
  {
    return (Generic)input;
  }
  
  public static Generic Get&lt;Generic&gt;(this Entity2 input)
  {
    return (Generic)input;
  }
  </code></pre>
  
  <p>It strikes me that a better approach would be to keep it in the same method body and still cover all the regarded types. Is there a syntax for including e.g. two different types in the signature? Something like this <strong>pseudo-code</strong> below.</p>
  
  <pre><code>public static Generic Get&lt;Generic&gt;(this [Entity, Entity2] input)
  {
    return (Generic)input;
  }
  </code></pre>
  
  <p>The best approach I can think of, as shown below, consists of a entry method for each type and the logic in a private place. It makes sense when the logic is extensive but looks kind of superfluous when it's only a line or two.</p>
  
  <pre><code>public static Generic Get&lt;Generic&gt;(this Entity input)
  {
    return CommonLogic(input);
  }
  
  public static Generic Get&lt;Generic&gt;(this Entity2 input)
  {
    return CommonLogic(input);
  }
  
  private static Generic CommonLogic(Object input)
  {
    return (Generic)input;
  }
  </code></pre>