的例子是這樣的:如何實現一個已經有一些其他接口的接口?
interface IA
{
ICollection<IB> Bs {get;set;}
}
interface IB
{
}
public class BBase : IB
{
}
public class ABase : IA
{
public ICollection<BBase> Bs { get; set; }
}
的問題是,當我想實現的接口IA
與BBase
,就像我在ABase
一樣,發生錯誤。是說我只能用IB
而不是BBase
來執行IA
的ABase
?
+1 - 可接受的有用方法。將接口簽名更改爲通用可能無法在所有情況下使用。 – 2013-02-28 07:28:10
@AlexeiLevenkov同意..在這種情況下,在我看來,OP只是開始設計 – horgh 2013-02-28 07:33:11
非常感謝! – user2118486 2013-02-28 07:42:48