One method multiple Interface return types
<p>Let's say I have</p>

<pre><code>public class ClassA : Ione, Itwo
public class ClassB : Ione, Itwo
public class ClassC : Ione, Itwo
</code></pre>

<p>and a method MethodA that returns an instance of ClassA, ClassB or ClassC.
MethodA return type can be Ione or Itwo.</p>

<p>How can I achive that?.</p>

<p>I have tryed using generics like this:</p>

<pre><code>public T MethodA&lt;T&gt;(myEnum e) where T : Ione, Itwo
</code></pre>

<p>but when typing <code>return (T)new ClassA();</code> I get the error "Cannot convert type ClassA to T".</p>

<p>Thanks.</p>
