Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #335 List to map

Create the map m containing all the elements e of the list a, using as key the field e.id.

var m = a.ToDictionary(e => e.id, e => e);

New implementation...
< >
programming-idioms.org