Advertisement
ivandrofly

Why use ICollection and not IEnumerable or List<T> on many-m

May 30th, 2014
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. vIf you are exposing your class through a library that others will use, you generally want to expose it via interfaces rather than concrete implementations. This will help if you decide to change the implementation of your class later to use a different concrete class. In that case the users of your library won't need to update their code since the interface doesn't change.
  2.  
  3. If you are just using it internally, you may not care so much, and using List<T> may be ok.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement