我嘗試寫看起來像這樣爲什麼這個通用接口定義是錯誤的?
public interface IPropertyGroupCollection
{
IEnumerable<IPropertyGroup> _Propertygroups { get;}
}
public interface IPropertyGroup
{
IEnumerable<IProperty<T, U, V>> _conditions { get; }
}
public interface IProperty<T, U, V>
{
T _p1 { get; }
U _p2 { get; }
V _p3 { get; }
}
public class Property<T, U, V> : IProperty<T, U, V>
{
//Some Implementation
}
我不斷獲取編譯錯誤的_Conditions的IEnumerable的定義一個接口。
我在做什麼錯了? 理念是實現類將成爲一個通用的屬性包集
用'object'替換所有泛型和你設置。 – ja72 2012-07-13 06:16:30