Table of Contents

Class GroupBy

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that groups the elements of an observable sequence according to the specified key.

Marble diagram

The GroupBy operator can be used to separate, or demultiplex, the elements from a single sequence into multiple sequences according to the specified KeySelector. Each element from the sequence will be routed to the correct group according to its key. Groups are created and emitted the first time that an element with a new distinct key value is received from the source sequence.

Note

You can manipulate and schedule each of the group sequences downstream using other higher-order operators such as Merge, Concat or Switch.

The members used to generate the elements in each group sequence can be optionally specified using the ElementSelector property. If no element selector is specified, the original values from the source sequence will be used.

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

Properties

ElementSelector

Gets or sets a value specifying the inner properties used as elements in each grouped sequence.

public string ElementSelector { get; set; }

Property Value

string

KeySelector

Gets or sets a value specifying the inner properties used as key for each element in the sequence.

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.