I have been hearing that it is important to use the lowest class possible when passing parameters to methods. Why is this? Also where can i find more information on what the class hierarchy is? I would like to know what IEnumerable inheriated from and so forth.
Share
If you use
IEnumerable<T>as a parameter type, then you can pass in any type that implements that interface. That includesList<T>,Stack<T>,Queue<T>, etc.It also includes various anonymous types that might be the result of a LINQ query, and also the very important
IQueryable<T>.