IEnumerable<T>
is a more general interface, so you can substitute anything that implements that interface for your operation. If you have this method:
public void DoSomething(IEnumerable<T> enumerable) {
}
It will work on arrays, collections, lists, dictionaries, and anything else that implements the interface.
If you specify that the object is a List<T>
, the method will only work on List<T>
objects or instances that inherit from it.
The advantage of using List<T>
is that lists have many more features than enumerables. When you need those features (insertion, searching, conversion, and many more), List<T>
or IList<T>
is more appropriate.