我有一个通用接口:
public interface IBaseInterface<T, TU>
where T: InterfaceT
where TU: InterfaceTU
{
T SomeClassT {get; set; }
TU SomeClassTU {get; set; }
}
我已经创建了许多使用不同
T
和
TU
.
public interface IFirstT: InterfaceT {}
public interface IFirstTU: InterfaceTU {}
public interface IFirstGlobal : IBaseInterface<IFirstT, IFirstTU> {}
我想用
IFirstGlobal
在新的基本接口上,无需发送
InterfaceT
和
InterfaceTU
类型(实际上是隐藏它们)。
基本上,这意味着IBaseInterface可以获得任何
接口网
&
接口图
.
以下是我尝试过的:
public interface INew<T>
where T: IBaseInterface<InterfaceT,InterfaceTU>
{
T SomeClass { get; set; }
}
我想
T
将
接受
IFirstGlobal
作为一种类型——但它
不会
.
还有其他想法吗?