让我举个例子:
我有一些通用的类/接口定义:
interface IGenericCar< T > {...}
我有另一个类/接口,我想与上面的类关联,例如:
interface IGarrage< TCar > : where TCar: IGenericCar< (**any type here**) > {...}
Basically, I want my generic IGarrage to be dependent on IGenericCar
, regardless if it's IGenericCar<int>
or IGenericCar<System.Color>
, because I don't have any dependency to that type.