System.Linq.Lookup<TKey,TElement> Class

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

See Also: Lookup<TKey,TElement> Members

Syntax

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

Type Parameters

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

Remarks

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.

Note:

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.

Requirements

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