Kinetic Code Camp - Bring your skills, or lack thereof.. :dumpster_fire:

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.

  1. Count all rows of a table:
    ds.table.Count
    (Notice the lack of parentheses)

  2. Count only the rows of the table returned by the Where clause:
    ds.table.Where(x => x.field1 == value).Count()
    (Parentheses after Count but nothing inside)

  3. Sum a field of the data returned by the where clause:
    ds.table.Where(x => x.field1 == value).Sum(y => y.field2)
    (Parentheses after Sum 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.)

4 Likes