THREE MONTHS LATER…
So, you’d all be proud: I hacked at some lambda notation all by myself (for this project). I sure don’t understand it, but I think I can use it. (Not all that different from a lot of other “skills” I have…)
@jtownsend, This pseudocode is perfect, by the way:
Something I discerned along the way: Count
has different personalities.
-
Count all rows of a table:
ds.table.Count
(Notice the lack of parentheses) -
Count only the rows of the table returned by the Where clause:
ds.table.Where(x => x.field1 == value).Count()
(Parentheses afterCount
but nothing inside) -
Sum a field of the data returned by the where clause:
ds.table.Where(x => x.field1 == value).Sum(y => y.field2)
(Parentheses afterSum
and need lambda expression inside the parentheses)
I kept trying to do Count(x => x.something)
a la #3. But that is not real.
(Yes #3 is exactly what @jtownsend posted earlier. It’s an example, not my example.)