Lookup<TKey, TElement> vs Dictionary<TKey, List<TValue>> for duplicate keys in C#
Use ToLookup when you group once and only read: it is immutable, returns an empty sequence for missing keys, accepts null keys and keeps first-seen order. Use Dictionary<TKey, List<TValue>> when the groups change after construction or cross a JSON boundary.