Table of Contents

Class ToLookup

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that creates a lookup from an observable sequence according to the specified key and element selector.

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.

public class ToLookup : SingleArgumentExpressionBuilder, IExpressionBuilder
Inheritance
ToLookup
Implements
Inherited Members
Extension Methods

Properties

ElementSelector

Gets or sets a value specifying the inner properties used as elements in the lookup.

public string ElementSelector { get; set; }

Property Value

string

KeySelector

Gets or sets a value specifying the inner properties used as keys in the lookup.

public string KeySelector { get; set; }

Property Value

string

Methods

Build(IEnumerable<Expression>)

Constructs an Expression node from a collection of input arguments. The result can be chained with other builders in a workflow.

public override Expression Build(IEnumerable<Expression> arguments)

Parameters

arguments IEnumerable<Expression>

A collection of Expression nodes representing the input arguments.

Returns

Expression

The constructed Expression node.