Constraints taking either types in generics
<p>In generics we can give constraints using the "<b>where</b>" clause like</p>

<pre>
public void MyGeneric &lt;T&gt;() where T : MyClass1 {...}
</pre>

<p>Now if i want the type T to be of type MyClass1 <b><i>and</i></b> say an interface IMyInterface then i need to do something like</p>

<pre>
public void MyGeneric &lt;T&gt;() where T : MyClass1, IMyInterface  {...}
</pre>

<p>But I dont know (or maybe it is not possible) if we can create a generic method that can take types which inherits from either of the 2 types. i.e. if any of my other classes inherits from MyClass1 <b><i>or</i></b> implements IMyInterface but neither of my class has both then my generic method should work for these classes.</p>

<p>I hope I have been clear.</p>
