Is there a way to test if T inherits/implements a class/interface?
private void MyGenericClass<T> ()
if(T ... inherits or implements some class/interface
There is a Method called Type.IsAssignableFrom().
It is used like this:
If you are targeting .NET Core, the method has moved to TypeInfo: