In the Essential C# 3.0 book, there is a part where it says:
“Projection using the select() method
is very powerful. We already saw how
to filter a collection vertically
(reducing the number of items in the
collection) using the Where() standard
query operator. Now, via the Select()
standard query operator, we can also
reduce the collection horizontally
(making fewer columns) or transform
the data entirely. In combination,Where() and Select() provide a means
for extracting only the pieces of the
original collection that are desirable
for the current algorithm.”
What does horizontally and vertically means in this case? Do these methods enumerate on a collection differently?
No, they enumerate the collection alike.
If you think of a collection as a set of objects (rows), each with some properties (columns) like a database table. You could filter the results out by removing some rows (vertically) by specifying a condition using
Whereor remove a set of columns bySelecting a subset of properties (horizontally).