IEnumerable is the base interface for all generic collections that can be enumerated (iterated through). Examples of classes that implement IEnumerable include Lists, Arrays, Stacks, and Queues. You can also write your own classes that implement it. Any class that implements this interface can have LINQ queries performed on its enumerator. You can also iterate through the collection using the For Each operator. T is the type of item that the collection stores. When you perform LINQ queries, you often get anonymous classes that implement the IEnumerable interface in return.
The System.Linq namespace contains all kinds of extension methods that operate on classes that implement the IEnumerable interface. This is what allows you to write LINQ queries against these objects.
No comments:
Post a Comment