I need help, I know that in C# we have Data-collections containers, like:
- Dictionary
- SortedDictionary
- SortedList
- List
- LinkedList
- HashSet
- And so on
But I've seen functions which return or take input parameters IEnumerable
.
public IEnumerable<Cars> GetCars()
{
}
What is above function returning, What Data collection Type ,container ? ???...IEnumerable
is not data collection container.??
I think i also have seen Interfaces used like this.
IEnumerable xList = new List();
IEnumerable D = new Dictionary();
IEnumerable L = new List();
Ilist p = new Hash(); < - Is this COrrect ?
What datacollection they returning ?
Why do people use Interface to return or hold data ?