Divooka Reference

Enumerable Routines

60 nodes

On this page 60

All

Function

Whether every element passes a test; it stops at the first that does not. An empty sequence answers true.

Signature
All -> Truth
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
bool All(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to test.
predicateFunc<TSource, Truth>—The test for each element.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Any

Function

Overload 1 of 2

Signature
Any(source: IEnumerable<TSource>) -> Truth
bool Any(IEnumerable<TSource> source)

Whether the sequence has any elements at all; it reads at most one, so it is the cheap way to test for emptiness.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to test.

Returns

resultTruth

Overload 2 of 2

Signature
Any -> Truth
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
bool Any(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

Whether at least one element passes a test; it stops at the first that does. An empty sequence answers false.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to test.
predicateFunc<TSource, Truth>—The test for each element.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Append

Function

The sequence with one more element at the end; the source itself is not changed.

Signature
Append -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    element: TSource
IEnumerable<TSource> Append(
    IEnumerable<TSource> source,
    TSource element)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to extend.
elementTSource—The element to add after the last one.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

As Enumerable

Function

Passes the sequence through unchanged but typed as a plain sequence, hiding its concrete collection type so that later steps treat it only as something to enumerate. A null input comes back as null.

Signature
AsEnumerable(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> AsEnumerable(IEnumerable<TSource> source)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to pass through.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Average

Function

Overload 1 of 20

Signature
Average(source: IEnumerable<Integer>) -> Number
double Average(IEnumerable<int> source)

The mean of the numbers, as a double so that it keeps its fraction. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<Integer>—The numbers to average.

Returns

resultNumber

Overload 2 of 20

Signature
Average(source: IEnumerable<Large Integer>) -> Number
double Average(IEnumerable<long> source)

The mean of the numbers, as a double so that it keeps its fraction. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<Large Integer>—The numbers to average.

Returns

resultNumber

Overload 3 of 20

Signature
Average(source: IEnumerable<Low Accuracy Number>) -> Low Accuracy Number
float Average(IEnumerable<float> source)

The mean of the numbers, worked out in double precision and rounded to float at the end. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<Low Accuracy Number>—The numbers to average.

Returns

resultLow Accuracy Number

Overload 4 of 20

Signature
Average(source: IEnumerable<Number>) -> Number
double Average(IEnumerable<double> source)

The mean of the numbers. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<Number>—The numbers to average.

Returns

resultNumber

Overload 5 of 20

Signature
Average(source: IEnumerable<High Accuracy Number>) -> High Accuracy Number
decimal Average(IEnumerable<decimal> source)

The mean of the numbers, in decimal arithmetic. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<High Accuracy Number>—The numbers to average.

Returns

resultHigh Accuracy Number

Overload 6 of 20

Signature
Average(source: IEnumerable<Optional Integer>) -> Optional Number
double? Average(IEnumerable<int?> source)

The mean of the numbers that are present, as a double; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Integer>—The numbers to average, some of which may be missing.

Returns

resultOptional Number

Overload 7 of 20

Signature
Average(source: IEnumerable<Optional Large Integer>) -> Optional Number
double? Average(IEnumerable<long?> source)

The mean of the numbers that are present, as a double; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Large Integer>—The numbers to average, some of which may be missing.

Returns

resultOptional Number

Overload 8 of 20

Signature
Average(source: IEnumerable<Optional Low Accuracy Number>) -> Optional Low Accuracy Number
float? Average(IEnumerable<float?> source)

The mean of the numbers that are present, worked out in double precision and rounded to float; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Low Accuracy Number>—The numbers to average, some of which may be missing.

Returns

resultOptional Low Accuracy Number

Overload 9 of 20

Signature
Average(source: IEnumerable<Optional Number>) -> Optional Number
double? Average(IEnumerable<double?> source)

The mean of the numbers that are present; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Number>—The numbers to average, some of which may be missing.

Returns

resultOptional Number

Overload 10 of 20

Signature
Average(source: IEnumerable<Optional High Accuracy Number>) -> Optional High Accuracy Number
decimal? Average(IEnumerable<decimal?> source)

The mean of the numbers that are present, in decimal arithmetic; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional High Accuracy Number>—The numbers to average, some of which may be missing.

Returns

resultOptional High Accuracy Number

Overload 11 of 20

Signature
Average -> Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Integer>
double Average(
    IEnumerable<TSource> source,
    Func<TSource, int> selector)

The mean of a number worked out from each element, for example the average age of a list of people, as a double. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Integer>—Gives the number for each element.

Returns

resultNumber

Overload 12 of 20

Signature
Average -> Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Large Integer>
double Average(
    IEnumerable<TSource> source,
    Func<TSource, long> selector)

The mean of a number worked out from each element, as a double. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Large Integer>—Gives the number for each element.

Returns

resultNumber

Overload 13 of 20

Signature
Average -> Low Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Low Accuracy Number>
float Average(
    IEnumerable<TSource> source,
    Func<TSource, float> selector)

The mean of a number worked out from each element, worked out in double precision and rounded to float at the end. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Low Accuracy Number>—Gives the number for each element.

Returns

resultLow Accuracy Number

Overload 14 of 20

Signature
Average -> Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Number>
double Average(
    IEnumerable<TSource> source,
    Func<TSource, double> selector)

The mean of a number worked out from each element. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Number>—Gives the number for each element.

Returns

resultNumber

Overload 15 of 20

Signature
Average -> High Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, High Accuracy Number>
decimal Average(
    IEnumerable<TSource> source,
    Func<TSource, decimal> selector)

The mean of a number worked out from each element, in decimal arithmetic. Throws System.InvalidOperationException when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, High Accuracy Number>—Gives the number for each element.

Returns

resultHigh Accuracy Number

Overload 16 of 20

Signature
Average -> Optional Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Integer>
double? Average(
    IEnumerable<TSource> source,
    Func<TSource, int?> selector)

The mean of a possibly missing number worked out from each element, as a double; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Optional Integer>—Gives the number for each element, or null to leave it out.

Returns

resultOptional Number

Overload 17 of 20

Signature
Average -> Optional Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Large Integer>
double? Average(
    IEnumerable<TSource> source,
    Func<TSource, long?> selector)

The mean of a possibly missing number worked out from each element, as a double; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Optional Large Integer>—Gives the number for each element, or null to leave it out.

Returns

resultOptional Number

Overload 18 of 20

Signature
Average -> Optional Low Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Low Accuracy Number>
float? Average(
    IEnumerable<TSource> source,
    Func<TSource, float?> selector)

The mean of a possibly missing number worked out from each element, in double precision rounded to float; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Optional Low Accuracy Number>—Gives the number for each element, or null to leave it out.

Returns

resultOptional Low Accuracy Number

Overload 19 of 20

Signature
Average -> Optional Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Number>
double? Average(
    IEnumerable<TSource> source,
    Func<TSource, double?> selector)

The mean of a possibly missing number worked out from each element; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Optional Number>—Gives the number for each element, or null to leave it out.

Returns

resultOptional Number

Overload 20 of 20

Signature
Average -> Optional High Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional High Accuracy Number>
decimal? Average(
    IEnumerable<TSource> source,
    Func<TSource, decimal?> selector)

The mean of a possibly missing number worked out from each element, in decimal arithmetic; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to average over.
selectorFunc<TSource, Optional High Accuracy Number>—Gives the number for each element, or null to leave it out.

Returns

resultOptional High Accuracy Number
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Cast

Function

Treats every element of an untyped sequence as a T Result, for when all elements are known to be of that type. Only reference and unboxing conversions are applied (a boxed int does not become a long), and an element that cannot be cast throws System.InvalidCastException when it is reached; use EnumerableRoutines.OfType to drop such elements instead.

Signature
Cast(source: IEnumerable) -> IEnumerable<TResult>
IEnumerable<TResult> Cast(IEnumerable source)

Parameters

nametypedefaultdescription
sourceIEnumerable—The untyped sequence to cast.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Chunk

Function

Splits the sequence into consecutive batches of Size elements, for example to process items a page at a time; the last batch is shorter when the length is not a multiple of the size. Throws System.ArgumentOutOfRangeException when Size is less than 1.

Signature
Chunk -> IEnumerable<TSource Array>
    source: IEnumerable<TSource>
    size: Integer
IEnumerable<TSource[]> Chunk(
    IEnumerable<TSource> source,
    int size)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to split.
sizeInteger—The number of elements in each batch.

Returns

resultIEnumerable<TSource Array>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Concat

Function

Joins two sequences end to end, keeping duplicates; use EnumerableRoutines.Union to merge without duplicates.

Signature
Concat -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
IEnumerable<TSource> Concat(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second)

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements come first.
secondIEnumerable<TSource>—The sequence whose elements follow.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Contains

Function

Overload 1 of 2

Signature
Contains(source: IEnumerable<TSource>, value: TSource) -> Truth
bool Contains(IEnumerable<TSource> source, TSource value)

Whether the sequence holds an element equal to Value, by the elements' default equality.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
valueTSource—The value to look for.

Returns

resultTruth

Overload 2 of 2

Signature
Contains -> Truth
    source: IEnumerable<TSource>
    value: TSource
    comparer: IEqualityComparer<TSource>
bool Contains(
    IEnumerable<TSource> source,
    TSource value,
    IEqualityComparer<TSource> comparer)

Whether the sequence holds an element equal to Value, with Comparer deciding equality (for example text compared without regard to case).

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
valueTSource—The value to look for.
comparerIEqualityComparer<TSource>—Decides whether two elements are equal; null uses the default equality.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Count

Function

Overload 1 of 2

Signature
Count(source: IEnumerable<TSource>) -> Integer
int Count(IEnumerable<TSource> source)

How many elements the sequence has. Throws System.OverflowException beyond Int32.MaxValue elements; use EnumerableRoutines.LongCount for sequences that long.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to count.

Returns

resultInteger

Overload 2 of 2

Signature
Count -> Integer
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
int Count(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

How many elements pass a test. Throws System.OverflowException beyond Int32.MaxValue matches.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to count in.
predicateFunc<TSource, Truth>—Answers true for each element to count.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Default If Empty

Function

Overload 1 of 2

Signature
DefaultIfEmpty(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> DefaultIfEmpty(IEnumerable<TSource> source)

The sequence unchanged when it has any elements; when it is empty, a sequence holding exactly one default value instead (null for reference and nullable types, zero or false for numbers and booleans), so that a later step always has something to work on.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence that might be empty.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
DefaultIfEmpty -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    defaultValue: TSource
IEnumerable<TSource> DefaultIfEmpty(
    IEnumerable<TSource> source,
    TSource defaultValue)

The sequence unchanged when it has any elements; when it is empty, a sequence holding exactly one Default Value instead, so that a later step always has something to work on.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence that might be empty.
defaultValueTSource—The single element to give when Source is empty.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Distinct

Function

Overload 1 of 2

Signature
Distinct(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> Distinct(IEnumerable<TSource> source)

The sequence with repeated elements removed, comparing elements by their default equality; the first occurrence of each is kept, in the order they first appear.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to remove duplicates from.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
Distinct -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    comparer: IEqualityComparer<TSource>
IEnumerable<TSource> Distinct(
    IEnumerable<TSource> source,
    IEqualityComparer<TSource> comparer)

The sequence with repeated elements removed, using Comparer to decide which elements are the same (for example text compared without regard to case); the first occurrence of each is kept, in the order they first appear.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to remove duplicates from.
comparerIEqualityComparer<TSource>—Decides whether two elements are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Distinct By

Function

Overload 1 of 2

Signature
DistinctBy -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
IEnumerable<TSource> DistinctBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

One element per key, for example one person per surname: the first element seen with each key is kept, in their original order.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to remove duplicates from.
keySelectorFunc<TSource, TKey>—Gives the key that decides whether two elements count as the same.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
DistinctBy -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IEqualityComparer<TKey>
IEnumerable<TSource> DistinctBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IEqualityComparer<TKey> comparer)

One element per key, with Comparer deciding which keys are the same; the first element seen with each key is kept, in their original order.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to remove duplicates from.
keySelectorFunc<TSource, TKey>—Gives the key that decides whether two elements count as the same.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Element At

Function

The element at a position, counting from zero. Throws System.ArgumentOutOfRangeException when Index is negative or not less than the number of elements.

Signature
ElementAt -> TSource
    source: IEnumerable<TSource>
    index: Integer
TSource ElementAt(IEnumerable<TSource> source, int index)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.
indexInteger—The zero-based position of the element.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Element At Or Default

Function

The element at a position, counting from zero, or the type's default value (null for reference and nullable types, zero for numbers) when Index is negative or past the end.

Signature
ElementAtOrDefault -> TSource
    source: IEnumerable<TSource>
    index: Integer
TSource ElementAtOrDefault(
    IEnumerable<TSource> source,
    int index)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.
indexInteger—The zero-based position of the element.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Empty

Function

A sequence with no elements, for use as a starting point or as a placeholder where a sequence input is required.

Signature
Empty() -> IEnumerable<TSource>
IEnumerable<TSource> Empty()

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Except

Function

Overload 1 of 2

Signature
Except -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
IEnumerable<TSource> Except(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second)

The distinct elements of First that do not appear in Second, in the order of First. This is a set difference, so repeats within First are removed as well.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence to take elements from.
secondIEnumerable<TSource>—The elements to leave out.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
Except -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
    comparer: IEqualityComparer<TSource>
IEnumerable<TSource> Except(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second,
    IEqualityComparer<TSource> comparer)

The distinct elements of First that do not appear in Second, with Comparer deciding which elements are the same; repeats within First are removed as well.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence to take elements from.
secondIEnumerable<TSource>—The elements to leave out.
comparerIEqualityComparer<TSource>—Decides whether two elements are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Except By

Function

Overload 1 of 2

Signature
ExceptBy -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TKey>
    keySelector: Func<TSource, TKey>
IEnumerable<TSource> ExceptBy(
    IEnumerable<TSource> first,
    IEnumerable<TKey> second,
    Func<TSource, TKey> keySelector)

The elements of First whose key is not in a list of keys, for example everyone except the IDs in an exclusion list; one element per key, the first seen, in the order of First.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence to take elements from.
secondIEnumerable<TKey>—The keys to leave out.
keySelectorFunc<TSource, TKey>—Gives the key of each element of First.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
ExceptBy -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TKey>
    keySelector: Func<TSource, TKey>
    comparer: IEqualityComparer<TKey>
IEnumerable<TSource> ExceptBy(
    IEnumerable<TSource> first,
    IEnumerable<TKey> second,
    Func<TSource, TKey> keySelector,
    IEqualityComparer<TKey> comparer)

The elements of First whose key is not in a list of keys, with Comparer deciding which keys are the same; one element per key, the first seen.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence to take elements from.
secondIEnumerable<TKey>—The keys to leave out.
keySelectorFunc<TSource, TKey>—Gives the key of each element of First.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

First

Function

Overload 1 of 2

Signature
First(source: IEnumerable<TSource>) -> TSource
TSource First(IEnumerable<TSource> source)

The first element. Throws System.InvalidOperationException when the sequence is empty; use EnumerableRoutines.FirstOrDefault to get a fallback instead.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.

Returns

ResultTSource

Overload 2 of 2

Signature
First -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
TSource First(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

The first element that passes a test. Throws System.InvalidOperationException when none does.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test each element is checked against, in order.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

First Or Default

Function

Overload 1 of 4

Signature
FirstOrDefault(source: IEnumerable<TSource>) -> TSource
TSource FirstOrDefault(IEnumerable<TSource> source)

The first element, or the type's default value (null for reference and nullable types, zero for numbers) when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.

Returns

ResultTSource

Overload 2 of 4

Signature
FirstOrDefault -> TSource
    source: IEnumerable<TSource>
    defaultValue: TSource
TSource FirstOrDefault(
    IEnumerable<TSource> source,
    TSource defaultValue)

The first element, or Default Value when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.
defaultValueTSource—What to give when there is no element.

Returns

ResultTSource

Overload 3 of 4

Signature
FirstOrDefault -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
TSource FirstOrDefault(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

The first element that passes a test, or the type's default value (null for reference and nullable types, zero for numbers) when none does.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test each element is checked against, in order.

Returns

ResultTSource

Overload 4 of 4

Signature
FirstOrDefault -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
    defaultValue: TSource
TSource FirstOrDefault(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate,
    TSource defaultValue)

The first element that passes a test, or Default Value when none does.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test each element is checked against, in order.
defaultValueTSource—What to give when no element passes.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Group By

Function

Overload 1 of 8

Signature
GroupBy -> IEnumerable<IGrouping<TKey, TSource>>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
IEnumerable<IGrouping<TKey, TSource>> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

Gathers elements that share a key into groups, for example orders by customer. Each group carries its key and its elements in their original order, and groups come in the order their keys first appear.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.

Returns

resultIEnumerable<IGrouping<TKey, TSource>>

Overload 2 of 8

Signature
GroupBy -> IEnumerable<IGrouping<TKey, TSource>>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IEqualityComparer<TKey>
IEnumerable<IGrouping<TKey, TSource>> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IEqualityComparer<TKey> comparer)

Gathers elements that share a key into groups, with Comparer deciding which keys are the same (for example names compared without regard to case). Groups come in the order their keys first appear.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<IGrouping<TKey, TSource>>

Overload 3 of 8

Signature
GroupBy -> IEnumerable<IGrouping<TKey, TElement>>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
IEnumerable<IGrouping<TKey, TElement>> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector)

Gathers elements that share a key into groups, storing only the part of each element that Element Selector picks out, for example order amounts grouped by customer.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.
elementSelectorFunc<TSource, TElement>—Gives the value stored in the group for each element.

Returns

resultIEnumerable<IGrouping<TKey, TElement>>

Overload 4 of 8

Signature
GroupBy -> IEnumerable<IGrouping<TKey, TElement>>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
    comparer: IEqualityComparer<TKey>
IEnumerable<IGrouping<TKey, TElement>> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector,
    IEqualityComparer<TKey> comparer)

Gathers elements that share a key into groups, storing only the part of each element that Element Selector picks out, with Comparer deciding which keys are the same.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.
elementSelectorFunc<TSource, TElement>—Gives the value stored in the group for each element.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<IGrouping<TKey, TElement>>

Overload 5 of 8

Signature
GroupBy -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    resultSelector: Func<TKey, IEnumerable<TSource>, TResult>
IEnumerable<TResult> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TKey, IEnumerable<TSource>, TResult> resultSelector)

Groups elements by key and turns each group into a single result, for example one (customer, number of orders) value per customer.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.
resultSelectorFunc<TKey, IEnumerable<TSource>, TResult>—Receives a key and its group's elements and gives the result for that group.

Returns

resultIEnumerable<TResult>

Overload 6 of 8

Signature
GroupBy -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    resultSelector: Func<TKey, IEnumerable<TSource>, TResult>
    comparer: IEqualityComparer<TKey>
IEnumerable<TResult> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TKey, IEnumerable<TSource>, TResult> resultSelector,
    IEqualityComparer<TKey> comparer)

Groups elements by key and turns each group into a single result, with Comparer deciding which keys are the same.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.
resultSelectorFunc<TKey, IEnumerable<TSource>, TResult>—Receives a key and its group's elements and gives the result for that group.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TResult>

Overload 7 of 8

Signature
GroupBy -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
    resultSelector: Func<TKey, IEnumerable<TElement>, TResult>
IEnumerable<TResult> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector,
    Func<TKey, IEnumerable<TElement>, TResult> resultSelector)

Groups elements by key, keeps only the part of each element that Element Selector picks out, and turns each group into a single result, for example one (customer, total spent) value per customer.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.
elementSelectorFunc<TSource, TElement>—Gives the value kept in the group for each element.
resultSelectorFunc<TKey, IEnumerable<TElement>, TResult>—Receives a key and its group's values and gives the result for that group.

Returns

resultIEnumerable<TResult>

Overload 8 of 8

Signature
GroupBy -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
    resultSelector: Func<TKey, IEnumerable<TElement>, TResult>
    comparer: IEqualityComparer<TKey>
IEnumerable<TResult> GroupBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector,
    Func<TKey, IEnumerable<TElement>, TResult> resultSelector,
    IEqualityComparer<TKey> comparer)

Groups elements by key, keeps only the part of each element that Element Selector picks out, and turns each group into a single result, with Comparer deciding which keys are the same.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to group.
keySelectorFunc<TSource, TKey>—Gives the key that decides each element's group.
elementSelectorFunc<TSource, TElement>—Gives the value kept in the group for each element.
resultSelectorFunc<TKey, IEnumerable<TElement>, TResult>—Receives a key and its group's values and gives the result for that group.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Group Join

Function

Overload 1 of 2

Signature
GroupJoin -> IEnumerable<TResult>
    outer: IEnumerable<TOuter>
    inner: IEnumerable<TInner>
    outerKeySelector: Func<TOuter, TKey>
    innerKeySelector: Func<TInner, TKey>
    resultSelector: Func<TOuter, IEnumerable<TInner>, TResult>
IEnumerable<TResult> GroupJoin(
    IEnumerable<TOuter> outer,
    IEnumerable<TInner> inner,
    Func<TOuter, TKey> outerKeySelector,
    Func<TInner, TKey> innerKeySelector,
    Func<TOuter, IEnumerable<TInner>, TResult> resultSelector)

Pairs each element of Outer with all the elements of Inner that share its key, for example each customer with their orders. Unlike Join, every outer element gives a result, with an empty collection when nothing matches, which makes this the basis of a left outer join.

Parameters

nametypedefaultdescription
outerIEnumerable<TOuter>—The sequence that gives one result per element.
innerIEnumerable<TInner>—The sequence whose elements are collected under matching outer elements.
outerKeySelectorFunc<TOuter, TKey>—Gives the key of each element of Outer.
innerKeySelectorFunc<TInner, TKey>—Gives the key of each element of Inner.
resultSelectorFunc<TOuter, IEnumerable<TInner>, TResult>—Receives an outer element and its matching inner elements and gives the result.

Returns

resultIEnumerable<TResult>

Overload 2 of 2

Signature
GroupJoin -> IEnumerable<TResult>
    outer: IEnumerable<TOuter>
    inner: IEnumerable<TInner>
    outerKeySelector: Func<TOuter, TKey>
    innerKeySelector: Func<TInner, TKey>
    resultSelector: Func<TOuter, IEnumerable<TInner>, TResult>
    comparer: IEqualityComparer<TKey>
IEnumerable<TResult> GroupJoin(
    IEnumerable<TOuter> outer,
    IEnumerable<TInner> inner,
    Func<TOuter, TKey> outerKeySelector,
    Func<TInner, TKey> innerKeySelector,
    Func<TOuter, IEnumerable<TInner>, TResult> resultSelector,
    IEqualityComparer<TKey> comparer)

Pairs each element of Outer with all the elements of Inner that share its key, with Comparer deciding which keys are equal; every outer element gives a result, with an empty collection when nothing matches.

Parameters

nametypedefaultdescription
outerIEnumerable<TOuter>—The sequence that gives one result per element.
innerIEnumerable<TInner>—The sequence whose elements are collected under matching outer elements.
outerKeySelectorFunc<TOuter, TKey>—Gives the key of each element of Outer.
innerKeySelectorFunc<TInner, TKey>—Gives the key of each element of Inner.
resultSelectorFunc<TOuter, IEnumerable<TInner>, TResult>—Receives an outer element and its matching inner elements and gives the result.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Intersect

Function

Overload 1 of 2

Signature
Intersect -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
IEnumerable<TSource> Intersect(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second)

The distinct elements of First that also appear in Second, in the order of First.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements are kept.
secondIEnumerable<TSource>—The sequence an element must also appear in.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
Intersect -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
    comparer: IEqualityComparer<TSource>
IEnumerable<TSource> Intersect(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second,
    IEqualityComparer<TSource> comparer)

The distinct elements of First that also appear in Second, with Comparer deciding which elements are the same.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements are kept.
secondIEnumerable<TSource>—The sequence an element must also appear in.
comparerIEqualityComparer<TSource>—Decides whether two elements are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Intersect By

Function

Overload 1 of 2

Signature
IntersectBy -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TKey>
    keySelector: Func<TSource, TKey>
IEnumerable<TSource> IntersectBy(
    IEnumerable<TSource> first,
    IEnumerable<TKey> second,
    Func<TSource, TKey> keySelector)

The elements of First whose key appears in a list of keys, for example the people whose IDs are in a selection; one element per key, the first seen, in the order of First.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements are kept.
secondIEnumerable<TKey>—The keys an element's key must be among.
keySelectorFunc<TSource, TKey>—Gives the key of each element of First.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
IntersectBy -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TKey>
    keySelector: Func<TSource, TKey>
    comparer: IEqualityComparer<TKey>
IEnumerable<TSource> IntersectBy(
    IEnumerable<TSource> first,
    IEnumerable<TKey> second,
    Func<TSource, TKey> keySelector,
    IEqualityComparer<TKey> comparer)

The elements of First whose key appears in a list of keys, with Comparer deciding which keys are the same; one element per key, the first seen.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements are kept.
secondIEnumerable<TKey>—The keys an element's key must be among.
keySelectorFunc<TSource, TKey>—Gives the key of each element of First.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Join

Function

Overload 1 of 2

Signature
Join -> IEnumerable<TResult>
    outer: IEnumerable<TOuter>
    inner: IEnumerable<TInner>
    outerKeySelector: Func<TOuter, TKey>
    innerKeySelector: Func<TInner, TKey>
    resultSelector: Func<TOuter, TInner, TResult>
IEnumerable<TResult> Join(
    IEnumerable<TOuter> outer,
    IEnumerable<TInner> inner,
    Func<TOuter, TKey> outerKeySelector,
    Func<TInner, TKey> innerKeySelector,
    Func<TOuter, TInner, TResult> resultSelector)

Matches elements of two sequences by key (an inner join), for example orders to their customers: every pair whose keys are equal gives one result. Elements with no match on the other side are left out, and null keys never match. Results follow the order of Outer, and within each, the order of Inner.

Parameters

nametypedefaultdescription
outerIEnumerable<TOuter>—The first sequence to join.
innerIEnumerable<TInner>—The sequence to match against.
outerKeySelectorFunc<TOuter, TKey>—Gives the key of each element of Outer.
innerKeySelectorFunc<TInner, TKey>—Gives the key of each element of Inner.
resultSelectorFunc<TOuter, TInner, TResult>—Combines a matching pair into a result.

Returns

resultIEnumerable<TResult>

Overload 2 of 2

Signature
Join -> IEnumerable<TResult>
    outer: IEnumerable<TOuter>
    inner: IEnumerable<TInner>
    outerKeySelector: Func<TOuter, TKey>
    innerKeySelector: Func<TInner, TKey>
    resultSelector: Func<TOuter, TInner, TResult>
    comparer: IEqualityComparer<TKey>
IEnumerable<TResult> Join(
    IEnumerable<TOuter> outer,
    IEnumerable<TInner> inner,
    Func<TOuter, TKey> outerKeySelector,
    Func<TInner, TKey> innerKeySelector,
    Func<TOuter, TInner, TResult> resultSelector,
    IEqualityComparer<TKey> comparer)

Matches elements of two sequences by key (an inner join), with Comparer deciding which keys are equal; every matching pair gives one result and unmatched elements are left out.

Parameters

nametypedefaultdescription
outerIEnumerable<TOuter>—The first sequence to join.
innerIEnumerable<TInner>—The sequence to match against.
outerKeySelectorFunc<TOuter, TKey>—Gives the key of each element of Outer.
innerKeySelectorFunc<TInner, TKey>—Gives the key of each element of Inner.
resultSelectorFunc<TOuter, TInner, TResult>—Combines a matching pair into a result.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Last

Function

Overload 1 of 2

Signature
Last(source: IEnumerable<TSource>) -> TSource
TSource Last(IEnumerable<TSource> source)

The last element. Throws System.InvalidOperationException when the sequence is empty; use EnumerableRoutines.LastOrDefault to get a fallback instead.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.

Returns

ResultTSource

Overload 2 of 2

Signature
Last -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
TSource Last(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

The last element that passes a test. Throws System.InvalidOperationException when none does.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test each element is checked against.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Last Or Default

Function

Overload 1 of 4

Signature
LastOrDefault(source: IEnumerable<TSource>) -> TSource
TSource LastOrDefault(IEnumerable<TSource> source)

The last element, or the type's default value (null for reference and nullable types, zero for numbers) when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.

Returns

ResultTSource

Overload 2 of 4

Signature
LastOrDefault -> TSource
    source: IEnumerable<TSource>
    defaultValue: TSource
TSource LastOrDefault(
    IEnumerable<TSource> source,
    TSource defaultValue)

The last element, or Default Value when the sequence is empty.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to read.
defaultValueTSource—What to give when there is no element.

Returns

ResultTSource

Overload 3 of 4

Signature
LastOrDefault -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
TSource LastOrDefault(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

The last element that passes a test, or the type's default value (null for reference and nullable types, zero for numbers) when none does.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test each element is checked against.

Returns

ResultTSource

Overload 4 of 4

Signature
LastOrDefault -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
    defaultValue: TSource
TSource LastOrDefault(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate,
    TSource defaultValue)

The last element that passes a test, or Default Value when none does.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test each element is checked against.
defaultValueTSource—What to give when no element passes.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Long Count

Function

Overload 1 of 2

Signature
LongCount(source: IEnumerable<TSource>) -> Large Integer
long LongCount(IEnumerable<TSource> source)

How many elements the sequence has, as a 64-bit number for sequences too long for EnumerableRoutines.Count.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to count.

Returns

resultLarge Integer

Overload 2 of 2

Signature
LongCount -> Large Integer
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
long LongCount(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

How many elements pass a test, as a 64-bit number.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to count in.
predicateFunc<TSource, Truth>—Answers true for each element to count.

Returns

resultLarge Integer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Max

Function

Overload 1 of 2

Signature
Max(source: IEnumerable<TSource>) -> TSource
TSource Max(IEnumerable<TSource> source)

The largest element, by the elements' default comparison. For reference or nullable element types, nulls are ignored and an empty sequence (or one holding only nulls) gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search; its elements must be comparable.

Returns

ResultTSource

Overload 2 of 2

Signature
Max -> TResult
    source: IEnumerable<TSource>
    selector: Func<TSource, TResult>
TResult Max(
    IEnumerable<TSource> source,
    Func<TSource, TResult> selector)

The largest value that Selector gives for any element, for example the highest score in a list of players. For reference or nullable result types, nulls are ignored and an empty sequence gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
selectorFunc<TSource, TResult>—Gives the comparable value for each element.

Returns

ResultTResult
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Min

Function

Overload 1 of 2

Signature
Min(source: IEnumerable<TSource>) -> TSource
TSource Min(IEnumerable<TSource> source)

The smallest element, by the elements' default comparison. For reference or nullable element types, nulls are ignored and an empty sequence (or one holding only nulls) gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search; its elements must be comparable.

Returns

ResultTSource

Overload 2 of 2

Signature
Min -> TResult
    source: IEnumerable<TSource>
    selector: Func<TSource, TResult>
TResult Min(
    IEnumerable<TSource> source,
    Func<TSource, TResult> selector)

The smallest value that Selector gives for any element, for example the lowest price in a list of items. For reference or nullable result types, nulls are ignored and an empty sequence gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
selectorFunc<TSource, TResult>—Gives the comparable value for each element.

Returns

ResultTResult
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Of Type

Function

Keeps only the elements of an untyped sequence that are a T Result (or derive from it); nulls and elements of any other type are dropped, so unlike EnumerableRoutines.Cast it never throws for a mismatched element.

Signature
OfType(source: IEnumerable) -> IEnumerable<TResult>
IEnumerable<TResult> OfType(IEnumerable source)

Parameters

nametypedefaultdescription
sourceIEnumerable—The untyped sequence to filter.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Order

Function

The elements sorted from smallest to largest by their default comparison (numbers by value, text in the current culture's order). The sort is stable, so equal elements keep their original order; the elements must be comparable, otherwise sorting fails when the result is read.

Signature
Order(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> Order(IEnumerable<TSource> source)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to sort.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Order By

Function

Overload 1 of 2

Signature
OrderBy -> IOrderedEnumerable<TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
IOrderedEnumerable<TSource> OrderBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

Sorts elements from smallest to largest by a key worked out from each, for example people by age. The sort is stable, so elements with equal keys keep their original order; follow it with EnumerableRoutines.ThenBy to break ties with a second key.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to sort.
keySelectorFunc<TSource, TKey>—Gives the key to sort each element by.

Returns

resultIOrderedEnumerable<TSource>

Overload 2 of 2

Signature
OrderBy -> IOrderedEnumerable<TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IComparer<TKey>
IOrderedEnumerable<TSource> OrderBy(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IComparer<TKey> comparer)

Sorts elements from smallest to largest by a key worked out from each, with Comparer deciding how keys are ordered. The sort is stable, so elements with equal keys keep their original order.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to sort.
keySelectorFunc<TSource, TKey>—Gives the key to sort each element by.
comparerIComparer<TKey>—Decides which of two keys comes first; null uses the key type's default comparison.

Returns

resultIOrderedEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Order By Descending

Function

Overload 1 of 2

Signature
OrderByDescending -> IOrderedEnumerable<TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
IOrderedEnumerable<TSource> OrderByDescending(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

Sorts elements from largest to smallest by a key worked out from each, for example scores from highest to lowest. The sort is stable, so elements with equal keys keep their original order.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to sort.
keySelectorFunc<TSource, TKey>—Gives the key to sort each element by.

Returns

resultIOrderedEnumerable<TSource>

Overload 2 of 2

Signature
OrderByDescending -> IOrderedEnumerable<TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IComparer<TKey>
IOrderedEnumerable<TSource> OrderByDescending(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IComparer<TKey> comparer)

Sorts elements from largest to smallest by a key worked out from each, with Comparer deciding how keys are ordered. The sort is stable, so elements with equal keys keep their original order.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to sort.
keySelectorFunc<TSource, TKey>—Gives the key to sort each element by.
comparerIComparer<TKey>—Decides which of two keys comes first; null uses the key type's default comparison.

Returns

resultIOrderedEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Order Descending

Function

The elements sorted from largest to smallest by their default comparison. The sort is stable, so equal elements keep their original order; the elements must be comparable, otherwise sorting fails when the result is read.

Signature
OrderDescending(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> OrderDescending(IEnumerable<TSource> source)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to sort.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Prepend

Function

The sequence with one more element at the start; the source itself is not changed.

Signature
Prepend -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    element: TSource
IEnumerable<TSource> Prepend(
    IEnumerable<TSource> source,
    TSource element)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to extend.
elementTSource—The element to put before the first one.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Range

Function

A run of consecutive whole numbers: Count of them, starting at Start, so a start of 1 and a count of 10 gives 1 to 10. Throws System.ArgumentOutOfRangeException when Count is negative or the last number would exceed Int32.MaxValue.

Signature
Range(start: Integer, count: Integer) -> IEnumerable<Integer>
IEnumerable<int> Range(int start, int count)

Parameters

nametypedefaultdescription
startInteger—The first number.
countInteger—How many numbers to give; zero gives an empty sequence.

Returns

resultIEnumerable<Integer>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Repeat

Function

A sequence holding the same value Count times. For a reference type every entry is the same object, not a copy. Throws System.ArgumentOutOfRangeException when Count is negative.

Signature
Repeat(element: TResult, count: Integer) -> IEnumerable<TResult>
IEnumerable<TResult> Repeat(TResult element, int count)

Parameters

nametypedefaultdescription
elementTResult—The value to repeat.
countInteger—How many times to repeat it; zero gives an empty sequence.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Reverse

Function

The elements in reverse order. The whole source is read before the first result is given, and the source itself is not changed.

Signature
Reverse(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> Reverse(IEnumerable<TSource> source)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to reverse.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Select

Function

Overload 1 of 2

Signature
Select -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    selector: Func<TSource, TResult>
IEnumerable<TResult> Select(
    IEnumerable<TSource> source,
    Func<TSource, TResult> selector)

Transforms each element through Selector, for example from a list of people to a list of their names.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to transform.
selectorFunc<TSource, TResult>—Gives the result for one element.

Returns

resultIEnumerable<TResult>

Overload 2 of 2

Signature
Select -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    selector: Func<TSource, Integer, TResult>
IEnumerable<TResult> Select(
    IEnumerable<TSource> source,
    Func<TSource, int, TResult> selector)

Transforms each element through Selector, which also receives the element's position, for example to number the elements.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to transform.
selectorFunc<TSource, Integer, TResult>—Gives the result for one element and its zero-based position in Source.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Select Many

Function

Overload 1 of 4

Signature
SelectMany -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    selector: Func<TSource, IEnumerable<TResult>>
IEnumerable<TResult> SelectMany(
    IEnumerable<TSource> source,
    Func<TSource, IEnumerable<TResult>> selector)

Turns each element into a sequence and joins all those sequences end to end into one flat sequence, for example from a list of folders to one list of all their files.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence whose elements each give a sequence.
selectorFunc<TSource, IEnumerable<TResult>>—Gives the sequence for one element.

Returns

resultIEnumerable<TResult>

Overload 2 of 4

Signature
SelectMany -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    selector: Func<TSource, Integer, IEnumerable<TResult>>
IEnumerable<TResult> SelectMany(
    IEnumerable<TSource> source,
    Func<TSource, int, IEnumerable<TResult>> selector)

Turns each element, together with its position, into a sequence and joins all those sequences end to end into one flat sequence.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence whose elements each give a sequence.
selectorFunc<TSource, Integer, IEnumerable<TResult>>—Gives the sequence for one element and its zero-based position in Source.

Returns

resultIEnumerable<TResult>

Overload 3 of 4

Signature
SelectMany -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    collectionSelector: Func<TSource, IEnumerable<TCollection>>
    resultSelector: Func<TSource, TCollection, TResult>
IEnumerable<TResult> SelectMany(
    IEnumerable<TSource> source,
    Func<TSource, IEnumerable<TCollection>> collectionSelector,
    Func<TSource, TCollection, TResult> resultSelector)

Flattens a sequence of sequences while keeping track of where each inner element came from: every inner element is combined with its source element by Result Selector, for example into (folder, file) pairs.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence whose elements each give a sequence.
collectionSelectorFunc<TSource, IEnumerable<TCollection>>—Gives the inner sequence for one element.
resultSelectorFunc<TSource, TCollection, TResult>—Combines a source element with one of its inner elements into a result.

Returns

resultIEnumerable<TResult>

Overload 4 of 4

Signature
SelectMany -> IEnumerable<TResult>
    source: IEnumerable<TSource>
    collectionSelector: Func<TSource, Integer, IEnumerable<TCollection>>
    resultSelector: Func<TSource, TCollection, TResult>
IEnumerable<TResult> SelectMany(
    IEnumerable<TSource> source,
    Func<TSource, int, IEnumerable<TCollection>> collectionSelector,
    Func<TSource, TCollection, TResult> resultSelector)

Flattens a sequence of sequences while keeping track of where each inner element came from; like the other overload, but Collection Selector also receives each source element's position.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence whose elements each give a sequence.
collectionSelectorFunc<TSource, Integer, IEnumerable<TCollection>>—Gives the inner sequence for one element and its zero-based position in Source.
resultSelectorFunc<TSource, TCollection, TResult>—Combines a source element with one of its inner elements into a result.

Returns

resultIEnumerable<TResult>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Single

Function

Overload 1 of 2

Signature
Single(source: IEnumerable<TSource>) -> TSource
TSource Single(IEnumerable<TSource> source)

The one and only element, for when having exactly one is an expectation worth checking. Throws System.InvalidOperationException when the sequence is empty or has more than one element.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence expected to hold exactly one element.

Returns

ResultTSource

Overload 2 of 2

Signature
Single -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
TSource Single(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

The one and only element that passes a test. Throws System.InvalidOperationException when no element passes or more than one does.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test exactly one element is expected to pass.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Single Or Default

Function

Overload 1 of 4

Signature
SingleOrDefault(source: IEnumerable<TSource>) -> TSource
TSource SingleOrDefault(IEnumerable<TSource> source)

The only element, or the type's default value (null for reference and nullable types, zero for numbers) when the sequence is empty. Still throws System.InvalidOperationException when there is more than one element.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence expected to hold at most one element.

Returns

ResultTSource

Overload 2 of 4

Signature
SingleOrDefault -> TSource
    source: IEnumerable<TSource>
    defaultValue: TSource
TSource SingleOrDefault(
    IEnumerable<TSource> source,
    TSource defaultValue)

The only element, or Default Value when the sequence is empty. Still throws System.InvalidOperationException when there is more than one element.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence expected to hold at most one element.
defaultValueTSource—What to give when there is no element.

Returns

ResultTSource

Overload 3 of 4

Signature
SingleOrDefault -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
TSource SingleOrDefault(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

The only element that passes a test, or the type's default value (null for reference and nullable types, zero for numbers) when none does. Still throws System.InvalidOperationException when more than one passes.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test at most one element is expected to pass.

Returns

ResultTSource

Overload 4 of 4

Signature
SingleOrDefault -> TSource
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
    defaultValue: TSource
TSource SingleOrDefault(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate,
    TSource defaultValue)

The only element that passes a test, or Default Value when none does. Still throws System.InvalidOperationException when more than one passes.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to search.
predicateFunc<TSource, Truth>—The test at most one element is expected to pass.
defaultValueTSource—What to give when no element passes.

Returns

ResultTSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Skip

Function

The sequence without its first Count elements. A count of zero or less gives the whole sequence, and a count at or beyond its length gives an empty one.

Signature
Skip -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    count: Integer
IEnumerable<TSource> Skip(
    IEnumerable<TSource> source,
    int count)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to skip into.
countInteger—How many elements to leave out from the start.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Skip Last

Function

The sequence without its last Count elements. A count of zero or less gives the whole sequence, and a count at or beyond its length gives an empty one.

Signature
SkipLast -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    count: Integer
IEnumerable<TSource> SkipLast(
    IEnumerable<TSource> source,
    int count)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to trim.
countInteger—How many elements to leave out from the end.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Skip While

Function

Overload 1 of 2

Signature
SkipWhile -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
IEnumerable<TSource> SkipWhile(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

Leaves out elements from the start for as long as Predicate answers true, then gives the first element it rejected and every element after it, whether or not they would pass.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to skip into.
predicateFunc<TSource, Truth>—Answers true for each leading element to leave out.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
SkipWhile -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    predicate: Func<TSource, Integer, Truth>
IEnumerable<TSource> SkipWhile(
    IEnumerable<TSource> source,
    Func<TSource, int, bool> predicate)

Leaves out elements from the start for as long as Predicate answers true, then gives the rest; the test also receives each element's position.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to skip into.
predicateFunc<TSource, Integer, Truth>—Receives an element and its zero-based position, and answers true to leave it out.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Sum

Function

Overload 1 of 20

Signature
Sum(source: IEnumerable<Integer>) -> Integer
int Sum(IEnumerable<int> source)

The total of the numbers; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in an int.

Parameters

nametypedefaultdescription
sourceIEnumerable<Integer>—The numbers to add up.

Returns

resultInteger

Overload 2 of 20

Signature
Sum(source: IEnumerable<Large Integer>) -> Large Integer
long Sum(IEnumerable<long> source)

The total of the numbers; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in a long.

Parameters

nametypedefaultdescription
sourceIEnumerable<Large Integer>—The numbers to add up.

Returns

resultLarge Integer

Overload 3 of 20

Signature
Sum(source: IEnumerable<Low Accuracy Number>) -> Low Accuracy Number
float Sum(IEnumerable<float> source)

The total of the numbers, added up in double precision and rounded to float at the end; an empty sequence gives 0, and a total too large for a float becomes infinity.

Parameters

nametypedefaultdescription
sourceIEnumerable<Low Accuracy Number>—The numbers to add up.

Returns

resultLow Accuracy Number

Overload 4 of 20

Signature
Sum(source: IEnumerable<Number>) -> Number
double Sum(IEnumerable<double> source)

The total of the numbers; an empty sequence gives 0, and a total too large for a double becomes infinity.

Parameters

nametypedefaultdescription
sourceIEnumerable<Number>—The numbers to add up.

Returns

resultNumber

Overload 5 of 20

Signature
Sum(source: IEnumerable<High Accuracy Number>) -> High Accuracy Number
decimal Sum(IEnumerable<decimal> source)

The exact decimal total of the numbers; an empty sequence gives 0. Throws System.OverflowException when the total exceeds the decimal range.

Parameters

nametypedefaultdescription
sourceIEnumerable<High Accuracy Number>—The numbers to add up.

Returns

resultHigh Accuracy Number

Overload 6 of 20

Signature
Sum(source: IEnumerable<Optional Integer>) -> Optional Integer
int? Sum(IEnumerable<int?> source)

The total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null. Throws System.OverflowException when the total does not fit in an int.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Integer>—The numbers to add up, some of which may be missing.

Returns

resultOptional Integer

Overload 7 of 20

Signature
Sum(source: IEnumerable<Optional Large Integer>) -> Optional Large Integer
long? Sum(IEnumerable<long?> source)

The total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null. Throws System.OverflowException when the total does not fit in a long.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Large Integer>—The numbers to add up, some of which may be missing.

Returns

resultOptional Large Integer

Overload 8 of 20

Signature
Sum(source: IEnumerable<Optional Low Accuracy Number>) -> Optional Low Accuracy Number
float? Sum(IEnumerable<float?> source)

The total of the numbers that are present, added up in double precision and rounded to float at the end; nulls are skipped, and an empty or all-null sequence gives 0, never null.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Low Accuracy Number>—The numbers to add up, some of which may be missing.

Returns

resultOptional Low Accuracy Number

Overload 9 of 20

Signature
Sum(source: IEnumerable<Optional Number>) -> Optional Number
double? Sum(IEnumerable<double?> source)

The total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional Number>—The numbers to add up, some of which may be missing.

Returns

resultOptional Number

Overload 10 of 20

Signature
Sum(source: IEnumerable<Optional High Accuracy Number>) -> Optional High Accuracy Number
decimal? Sum(IEnumerable<decimal?> source)

The exact decimal total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null. Throws System.OverflowException when the total exceeds the decimal range.

Parameters

nametypedefaultdescription
sourceIEnumerable<Optional High Accuracy Number>—The numbers to add up, some of which may be missing.

Returns

resultOptional High Accuracy Number

Overload 11 of 20

Signature
Sum -> Integer
    source: IEnumerable<TSource>
    selector: Func<TSource, Integer>
int Sum(
    IEnumerable<TSource> source,
    Func<TSource, int> selector)

The total of a number worked out from each element, for example the quantities in a list of order lines; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in an int.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Integer>—Gives the number for each element.

Returns

resultInteger

Overload 12 of 20

Signature
Sum -> Large Integer
    source: IEnumerable<TSource>
    selector: Func<TSource, Large Integer>
long Sum(
    IEnumerable<TSource> source,
    Func<TSource, long> selector)

The total of a number worked out from each element; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in a long.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Large Integer>—Gives the number for each element.

Returns

resultLarge Integer

Overload 13 of 20

Signature
Sum -> Low Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Low Accuracy Number>
float Sum(
    IEnumerable<TSource> source,
    Func<TSource, float> selector)

The total of a number worked out from each element, added up in double precision and rounded to float at the end; an empty sequence gives 0.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Low Accuracy Number>—Gives the number for each element.

Returns

resultLow Accuracy Number

Overload 14 of 20

Signature
Sum -> Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Number>
double Sum(
    IEnumerable<TSource> source,
    Func<TSource, double> selector)

The total of a number worked out from each element, for example the lengths of a list of segments; an empty sequence gives 0.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Number>—Gives the number for each element.

Returns

resultNumber

Overload 15 of 20

Signature
Sum -> High Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, High Accuracy Number>
decimal Sum(
    IEnumerable<TSource> source,
    Func<TSource, decimal> selector)

The exact decimal total of a number worked out from each element, for example the prices in a basket; an empty sequence gives 0. Throws System.OverflowException when the total exceeds the decimal range.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, High Accuracy Number>—Gives the number for each element.

Returns

resultHigh Accuracy Number

Overload 16 of 20

Signature
Sum -> Optional Integer
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Integer>
int? Sum(
    IEnumerable<TSource> source,
    Func<TSource, int?> selector)

The total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null. Throws System.OverflowException when the total does not fit in an int.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Optional Integer>—Gives the number for each element, or null to skip it.

Returns

resultOptional Integer

Overload 17 of 20

Signature
Sum -> Optional Large Integer
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Large Integer>
long? Sum(
    IEnumerable<TSource> source,
    Func<TSource, long?> selector)

The total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null. Throws System.OverflowException when the total does not fit in a long.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Optional Large Integer>—Gives the number for each element, or null to skip it.

Returns

resultOptional Large Integer

Overload 18 of 20

Signature
Sum -> Optional Low Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Low Accuracy Number>
float? Sum(
    IEnumerable<TSource> source,
    Func<TSource, float?> selector)

The total of a possibly missing number worked out from each element, added up in double precision and rounded to float at the end; nulls are skipped, and an empty sequence or all nulls gives 0, never null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Optional Low Accuracy Number>—Gives the number for each element, or null to skip it.

Returns

resultOptional Low Accuracy Number

Overload 19 of 20

Signature
Sum -> Optional Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional Number>
double? Sum(
    IEnumerable<TSource> source,
    Func<TSource, double?> selector)

The total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Optional Number>—Gives the number for each element, or null to skip it.

Returns

resultOptional Number

Overload 20 of 20

Signature
Sum -> Optional High Accuracy Number
    source: IEnumerable<TSource>
    selector: Func<TSource, Optional High Accuracy Number>
decimal? Sum(
    IEnumerable<TSource> source,
    Func<TSource, decimal?> selector)

The exact decimal total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null. Throws System.OverflowException when the total exceeds the decimal range.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The elements to add up over.
selectorFunc<TSource, Optional High Accuracy Number>—Gives the number for each element, or null to skip it.

Returns

resultOptional High Accuracy Number
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Take

Function

The first Count elements of the sequence: fewer when it is shorter, and none when the count is zero or less.

Signature
Take -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    count: Integer
IEnumerable<TSource> Take(
    IEnumerable<TSource> source,
    int count)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to take from.
countInteger—How many elements to take from the start.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Take Last

Function

The last Count elements of the sequence: fewer when it is shorter, and none when the count is zero or less.

Signature
TakeLast -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    count: Integer
IEnumerable<TSource> TakeLast(
    IEnumerable<TSource> source,
    int count)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to take from.
countInteger—How many elements to take from the end.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Take While

Function

Overload 1 of 2

Signature
TakeWhile -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
IEnumerable<TSource> TakeWhile(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

Elements from the start for as long as Predicate answers true; it stops at the first element that fails, even if later elements would pass.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to take from.
predicateFunc<TSource, Truth>—Answers true for each leading element to take.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
TakeWhile -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    predicate: Func<TSource, Integer, Truth>
IEnumerable<TSource> TakeWhile(
    IEnumerable<TSource> source,
    Func<TSource, int, bool> predicate)

Elements from the start for as long as Predicate answers true; the test also receives each element's position.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to take from.
predicateFunc<TSource, Integer, Truth>—Receives an element and its zero-based position, and answers true to take it.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Then By

Function

Overload 1 of 2

Signature
ThenBy -> IOrderedEnumerable<TSource>
    source: IOrderedEnumerable<TSource>
    keySelector: Func<TSource, TKey>
IOrderedEnumerable<TSource> ThenBy(
    IOrderedEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

Refines an existing sort: elements that tie on the earlier keys are put in ascending order of this further key, for example surname then first name. The input must come from an OrderBy, OrderByDescending, ThenBy or ThenByDescending node.

Parameters

nametypedefaultdescription
sourceIOrderedEnumerable<TSource>—The already sorted sequence.
keySelectorFunc<TSource, TKey>—Gives the tie-breaking key for each element.

Returns

resultIOrderedEnumerable<TSource>

Overload 2 of 2

Signature
ThenBy -> IOrderedEnumerable<TSource>
    source: IOrderedEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IComparer<TKey>
IOrderedEnumerable<TSource> ThenBy(
    IOrderedEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IComparer<TKey> comparer)

Refines an existing sort: elements that tie on the earlier keys are put in ascending order of this further key, with Comparer deciding how keys are ordered.

Parameters

nametypedefaultdescription
sourceIOrderedEnumerable<TSource>—The already sorted sequence.
keySelectorFunc<TSource, TKey>—Gives the tie-breaking key for each element.
comparerIComparer<TKey>—Decides which of two keys comes first; null uses the key type's default comparison.

Returns

resultIOrderedEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Then By Descending

Function

Overload 1 of 2

Signature
ThenByDescending -> IOrderedEnumerable<TSource>
    source: IOrderedEnumerable<TSource>
    keySelector: Func<TSource, TKey>
IOrderedEnumerable<TSource> ThenByDescending(
    IOrderedEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

Refines an existing sort: elements that tie on the earlier keys are put in descending order of this further key. The input must come from an OrderBy, OrderByDescending, ThenBy or ThenByDescending node.

Parameters

nametypedefaultdescription
sourceIOrderedEnumerable<TSource>—The already sorted sequence.
keySelectorFunc<TSource, TKey>—Gives the tie-breaking key for each element.

Returns

resultIOrderedEnumerable<TSource>

Overload 2 of 2

Signature
ThenByDescending -> IOrderedEnumerable<TSource>
    source: IOrderedEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IComparer<TKey>
IOrderedEnumerable<TSource> ThenByDescending(
    IOrderedEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IComparer<TKey> comparer)

Refines an existing sort: elements that tie on the earlier keys are put in descending order of this further key, with Comparer deciding how keys are ordered.

Parameters

nametypedefaultdescription
sourceIOrderedEnumerable<TSource>—The already sorted sequence.
keySelectorFunc<TSource, TKey>—Gives the tie-breaking key for each element.
comparerIComparer<TKey>—Decides which of two keys comes first; null uses the key type's default comparison.

Returns

resultIOrderedEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

To Array

Function

Reads the whole sequence now and copies its elements into a new array, so later steps work on a fixed snapshot instead of re-running the query.

Signature
ToArray(source: IEnumerable<TSource>) -> TSource Array
TSource[] ToArray(IEnumerable<TSource> source)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to copy.

Returns

resultTSource Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

To Dictionary

Function

Overload 1 of 6

Signature
ToDictionary -> Dictionary of TKey to TSource
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
Dictionary<TKey, TSource> ToDictionary(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

Reads the whole sequence into a new dictionary, keying each element by Key Selector. Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null; use ToLookup when keys can repeat.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.

Returns

resultDictionary of TKey to TSource

Overload 2 of 6

Signature
ToDictionary -> Dictionary of TKey to TSource
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IEqualityComparer<TKey>
Dictionary<TKey, TSource> ToDictionary(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IEqualityComparer<TKey> comparer)

Reads the whole sequence into a new dictionary, keying each element by Key Selector, with Comparer deciding which keys are the same (the dictionary keeps using it for lookups). Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultDictionary of TKey to TSource

Overload 3 of 6

Signature
ToDictionary -> Dictionary of TKey to TElement
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
Dictionary<TKey, TElement> ToDictionary(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector)

Reads the whole sequence into a new dictionary, with a key and a value worked out from each element, for example name to phone number. Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.
elementSelectorFunc<TSource, TElement>—Gives the value stored for each element.

Returns

resultDictionary of TKey to TElement

Overload 4 of 6

Signature
ToDictionary -> Dictionary of TKey to TElement
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
    comparer: IEqualityComparer<TKey>
Dictionary<TKey, TElement> ToDictionary(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector,
    IEqualityComparer<TKey> comparer)

Reads the whole sequence into a new dictionary, with a key and a value worked out from each element and Comparer deciding which keys are the same. Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.
elementSelectorFunc<TSource, TElement>—Gives the value stored for each element.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultDictionary of TKey to TElement

Overload 5 of 6

Signature
ToDictionary(source: IEnumerable<KeyValuePair<TKey, TValue>>) -> Dictionary of TKey to TValue
Dictionary<TKey, TValue> ToDictionary(IEnumerable<KeyValuePair<TKey, TValue>> source)

Reads a sequence of key-value pairs into a new dictionary. Throws System.ArgumentException when a key appears twice and System.ArgumentNullException when a key is null.

Parameters

nametypedefaultdescription
sourceIEnumerable<KeyValuePair<TKey, TValue>>—The key-value pairs to store.

Returns

resultDictionary of TKey to TValue

Overload 6 of 6

Signature
ToDictionary -> Dictionary of TKey to TValue
    source: IEnumerable<KeyValuePair<TKey, TValue>>
    comparer: IEqualityComparer<TKey>
Dictionary<TKey, TValue> ToDictionary(
    IEnumerable<KeyValuePair<TKey, TValue>> source,
    IEqualityComparer<TKey> comparer)

Reads a sequence of key-value pairs into a new dictionary, with Comparer deciding which keys are the same (the dictionary keeps using it for lookups). Throws System.ArgumentException when a key appears twice and System.ArgumentNullException when a key is null.

Parameters

nametypedefaultdescription
sourceIEnumerable<KeyValuePair<TKey, TValue>>—The key-value pairs to store.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultDictionary of TKey to TValue
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

To Hash Set

Function

Overload 1 of 2

Signature
ToHashSet(source: IEnumerable<TSource>) -> Set of TSource
HashSet<TSource> ToHashSet(IEnumerable<TSource> source)

Reads the whole sequence into a new set, dropping duplicates, for fast membership tests or further set operations.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to collect.

Returns

resultSet of TSource

Overload 2 of 2

Signature
ToHashSet -> Set of TSource
    source: IEnumerable<TSource>
    comparer: IEqualityComparer<TSource>
HashSet<TSource> ToHashSet(
    IEnumerable<TSource> source,
    IEqualityComparer<TSource> comparer)

Reads the whole sequence into a new set, with Comparer deciding which elements are duplicates (the set keeps using it for later membership tests).

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to collect.
comparerIEqualityComparer<TSource>—Decides whether two elements are equal; null uses the default equality.

Returns

resultSet of TSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

To List

Function

Reads the whole sequence now and copies its elements into a new list, so later steps work on a fixed snapshot that can also be added to.

Signature
ToList(source: IEnumerable<TSource>) -> List of TSource
List<TSource> ToList(IEnumerable<TSource> source)

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to copy.

Returns

resultList of TSource
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

To Lookup

Function

Overload 1 of 4

Signature
ToLookup -> ILookup<TKey, TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
ILookup<TKey, TSource> ToLookup(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector)

Reads the whole sequence now into a lookup: a fixed, read-only grouping in which each key can have many elements, for example all orders per customer. Asking it for a key that has no elements gives an empty sequence rather than an error, and null keys are allowed.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.

Returns

resultILookup<TKey, TSource>

Overload 2 of 4

Signature
ToLookup -> ILookup<TKey, TSource>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IEqualityComparer<TKey>
ILookup<TKey, TSource> ToLookup(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    IEqualityComparer<TKey> comparer)

Reads the whole sequence now into a lookup in which each key can have many elements, with Comparer deciding which keys are the same. A key with no elements gives an empty sequence.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultILookup<TKey, TSource>

Overload 3 of 4

Signature
ToLookup -> ILookup<TKey, TElement>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
ILookup<TKey, TElement> ToLookup(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector)

Reads the whole sequence now into a lookup in which each key can have many values, storing only the part of each element that Element Selector picks out. A key with no values gives an empty sequence.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.
elementSelectorFunc<TSource, TElement>—Gives the value stored for each element.

Returns

resultILookup<TKey, TElement>

Overload 4 of 4

Signature
ToLookup -> ILookup<TKey, TElement>
    source: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    elementSelector: Func<TSource, TElement>
    comparer: IEqualityComparer<TKey>
ILookup<TKey, TElement> ToLookup(
    IEnumerable<TSource> source,
    Func<TSource, TKey> keySelector,
    Func<TSource, TElement> elementSelector,
    IEqualityComparer<TKey> comparer)

Reads the whole sequence now into a lookup in which each key can have many values, storing only the part of each element that Element Selector picks out, with Comparer deciding which keys are the same.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to index.
keySelectorFunc<TSource, TKey>—Gives the key of each element.
elementSelectorFunc<TSource, TElement>—Gives the value stored for each element.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultILookup<TKey, TElement>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Union

Function

Overload 1 of 2

Signature
Union -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
IEnumerable<TSource> Union(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second)

Every distinct element found in either sequence: those of First in order, then those of Second not already seen. Duplicates within either sequence are removed too.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements come first.
secondIEnumerable<TSource>—The sequence whose new elements follow.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
Union -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
    comparer: IEqualityComparer<TSource>
IEnumerable<TSource> Union(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second,
    IEqualityComparer<TSource> comparer)

Every distinct element found in either sequence, with Comparer deciding which elements are the same: those of First in order, then those of Second not already seen.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements come first.
secondIEnumerable<TSource>—The sequence whose new elements follow.
comparerIEqualityComparer<TSource>—Decides whether two elements are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Union By

Function

Overload 1 of 2

Signature
UnionBy -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
IEnumerable<TSource> UnionBy(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second,
    Func<TSource, TKey> keySelector)

Merges two sequences keeping one element per key, for example one entry per ID across two lists; the first element seen with each key is kept, those of First before those of Second.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements come first.
secondIEnumerable<TSource>—The sequence whose elements with new keys follow.
keySelectorFunc<TSource, TKey>—Gives the key that decides whether two elements count as the same.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
UnionBy -> IEnumerable<TSource>
    first: IEnumerable<TSource>
    second: IEnumerable<TSource>
    keySelector: Func<TSource, TKey>
    comparer: IEqualityComparer<TKey>
IEnumerable<TSource> UnionBy(
    IEnumerable<TSource> first,
    IEnumerable<TSource> second,
    Func<TSource, TKey> keySelector,
    IEqualityComparer<TKey> comparer)

Merges two sequences keeping one element per key, with Comparer deciding which keys are the same; the first element seen with each key is kept.

Parameters

nametypedefaultdescription
firstIEnumerable<TSource>—The sequence whose elements come first.
secondIEnumerable<TSource>—The sequence whose elements with new keys follow.
keySelectorFunc<TSource, TKey>—Gives the key that decides whether two elements count as the same.
comparerIEqualityComparer<TKey>—Decides whether two keys are equal; null uses the default equality.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library

Where

Function

Overload 1 of 2

Signature
Where -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    predicate: Func<TSource, Truth>
IEnumerable<TSource> Where(
    IEnumerable<TSource> source,
    Func<TSource, bool> predicate)

Filters a sequence: only the elements for which Predicate answers true, in their original order.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to filter.
predicateFunc<TSource, Truth>—Answers true for each element to keep.

Returns

resultIEnumerable<TSource>

Overload 2 of 2

Signature
Where -> IEnumerable<TSource>
    source: IEnumerable<TSource>
    predicate: Func<TSource, Integer, Truth>
IEnumerable<TSource> Where(
    IEnumerable<TSource> source,
    Func<TSource, int, bool> predicate)

Filters a sequence with a test that can also see each element's position, for example to keep every other element.

Parameters

nametypedefaultdescription
sourceIEnumerable<TSource>—The sequence to filter.
predicateFunc<TSource, Integer, Truth>—Receives an element and its zero-based position in Source, and answers true to keep it.

Returns

resultIEnumerable<TSource>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Enumerable Routines
Package
Standard Library