title: How to make an extension method on interface available on all implementing classes?
body: <p>I have a class <em>Triangle</em> and I added an extension method to the type <em>List&lt;Triangle></em> as shown below. It works just as one would expect.</p>
  
  <pre><code>public static string Export(this List&lt;Triangle&gt; self) { ... }
  </code></pre>
  
  <p>However, I also have other classes, like <em>Rectangle</em> and <em>Trapezoid</em>, which would need each own <em>Export</em> function, like this.</p>
  
  <pre><code>public static string Export(this List&lt;Rectangle&gt; self) { ... }
  public static string Export(this List&lt;Trapezoid&gt; self) { ... }
  </code></pre>
  
  <p>Since the code in it the method is exactly the same and will remain so for any new kind of figure, I figured out (get it? <em>figured</em> out) that it's suitable to go for an interface. So, the classes are now implementing <em>IFigure</em>, which allowed me to consolidate the code in the extensions as shown below.</p>
  
  <pre><code>    public static string Export(this List&lt;IFigure&gt; self) { ... }
  </code></pre>
  
  <p>The only problem is that now the code doesn't compile because the lists of specific implementations doesn't know about the extension method. I'll have to change all the methods that return the type e.g. <em>List</em> to returning type <em>List&lt;IFigure></em> and it seems like a lot of work. Besides that, I fear that I then will need to convert those lists to the actual implmented classes for all the operations except the exporting.</p>
  
  <p>Is it possible to have an extension method on interface type so that it covers all the implementing classes?</p>