I want to know the exact place where we should use IEnumberable<T>
I know how IEnumerable<T>
work and returns IEnumerator<T>
and all that but the ultimate goal of IEnumerable<T>
is to query the data from the collection isn't it? That is what we can already do using foreach() loop ? So when to use IEnumerable<T>
? what is the actual practical scenario where the IEnumerable<T>
is the only option to query the collection?