【发布时间】:2018-05-04 08:35:53
【问题描述】:
我正在查看为IDictionary<TKey, TValue> 接口生成的元数据,我注意到它实现了
public interface IDictionary<TKey, TValue> : ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
这不是多余的吗?查看ICollection<T>的元数据表明它已经实现了IEnumerable<T>, IEnumerable
为什么IEnumerable<T> 实现了IEnumerable,而ICollection<T> 没有实现ICollection?
【问题讨论】:
-
你看过这篇stackoverflow.com/questions/46541462/…的帖子了吗?
-
元数据列出了所有直接或间接实现的接口。第二个问题在这里有答案:stackoverflow.com/q/2353346/5311735
标签: c# interface implementation