Table of Contents

Marble diagram

ToLookup collects all the values from the source sequence and creates a mapping from keys to a set of elements using the specified KeySelector and ElementSelector properties. The lookup is emitted when the source sequence completes successfully, and will have key and element types matching the selected members.

Note

A lookup allows multiple values to be grouped under the same key.

Warning

If the source sequence is infinite (i.e. does not terminate), this operator will never emit the collection, and will keep accumulating all elements from the source sequence indefinitely, with likely impacts on available memory.