Take the 2-minute tour ×  This question already has an answer
here:  I've noticed in other people's code that methods
returning generic collections will almost always return an
interface (e.g. IEnumerable<T> or IList<T>) rather than a
concrete implementation.  I have two related questions. Firstly,
why (if at all) is it considered better to return an interface?
Secondly, is there a collection interface that includes the Sort
method (as List<T> does)?  share|improve this question  marked
as duplicate by nawfal, Code Lღver, Daniel Kelley, NDM, 4dgaurav
Jun 19 at 10:09   4 Answers 4  up vote 2 down vote accepted
From C# - List or IList  If 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 user's
of your library won't need to update their code since the
interface doesn't change.  If