score:13

Accepted answer

sounds like you want to group by id and then convert to a dictionary, so that you end up with one dictionary entry per id:

var dictionary = entries.groupby(x => x.id)
                        .todictionary(g => g.key,
                                      // find the earliest time for each group
                                      g => g.min(x => x.time));

or:

                         // group by id, with each value being the time
var dictionary = entries.groupby(x => x.id, x => x.time)
                         // find the earliest value in each group
                        .todictionary(g => g.key, g => g.min())

Related Query

More Query from same tag