ICollection<T>
is an interface that exposes collection semantics such as Add()
, Remove()
, and Count
.
Collection<T>
is a concrete implementation of the ICollection<T>
interface.
IList<T>
is essentially an ICollection<T>
with random order-based access.
In this case you should decide whether or not your results require list semantics such as order based indexing (then use IList<T>
) or whether you just need to return an unordered "bag" of results (then use ICollection<T>
).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…