System.Linq.Lookup<TKey,TElement> Class

Represents a collection of keys each mapped to one or more values.

See Also: Lookup<TKey,TElement> Members


public class Lookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement>>, ILookup<TKey, TElement>

Type Parameters

Documentation for this section has not yet been entered.
Documentation for this section has not yet been entered.


A System.Linq.Lookup`2 resembles a Dictionary`2. The difference is that a Dictionary`2 maps keys to single values, whereas a System.Linq.Lookup`2 maps keys to collections of values.

You can create an instance of a System.Linq.Lookup`2 by calling Enumerable.ToLookup``2(IEnumerable<``0>, Func<``0, ``1>) on an object that implements IEnumerable`1.


There is no public constructor to create a new instance of a System.Linq.Lookup`2. Additionally, System.Linq.Lookup`2 objects are immutable, that is, you cannot add or remove elements or keys from a System.Linq.Lookup`2 object after it has been created.


Namespace: System.Linq
Assembly: System.Core (in System.Core.dll)
Assembly Versions:,