How to call InterfaceMethods from Generic Interfaces
<p>Lets say, I have a generic Interface </p>

<pre class="lang-cs prettyprint-override"><code>IWhatEver&lt;T&gt; : where T : ....
{
    T DoStuff(object value);
}

class Foo : IWhatEver&lt;string&gt; {...}
class Bar: IWhatEver&lt;double&gt; {...}
</code></pre>

<p>This Interface is implemented by a few classes.</p>

<p>How can I store instances of this interface in a list and how do I call the DoStuff function?</p>

<p>Something like this:</p>

<pre class="lang-cs prettyprint-override"><code>List&lt;IWhatEver&lt;????&gt;&gt; whatEvers = new List&lt;IWhatEver&lt;????&gt;&gt;();  // doesnt work...

whatEvers.Add(new Foo());
whatEvers.Add(new Bar());


var whatWillThisBe = whatEvers.Select(w =&gt; w.DoStuff(withSomeObject));
</code></pre>

<p>I believe this isnt even possible, but maybe I forgot something here?</p>
