如何选择使用IEnumerable, ICollection, IList

● 如果只想遍历集合,使用IEnumerable, IEnumerable<T>
● 如果想遍历、修改集合,以及需要延迟加载的导航属性,使用ICollection, ICollection<T>
● 如果想遍历、修改、添加、清空、使用索引,使用IList, IList<T>

posted @ 2018-05-04 11:18  hj0612  阅读(205)  评论(0编辑  收藏  举报