Great job — we just covered a lot of LINQ! Here’s a recap:
System.Linqnamespace in your file.
IEnumerable<T>. That means it works with
foreachloops and its length is accessible with
varis an implicit type, meaning it gets all of the benefits of type-checking without our specifying the actual type.
Whereoperator is used to select certain elements from a sequence.
Selectoperator determines what is returned for each element in the sequence.
fromoperator declares a range variable that is used to traverse the sequence.
If you’re curious or want more practice, here are some additional resources:
There are a few bugs in this code! Fix each one before moving on.