Skip to content
Eugene Sadovoi edited this page Jun 7, 2017 · 14 revisions

This library is a set of features that extends powerful query capabilities to any JavaScript based language. It is a complete implementation of LINQ (Language-Integrated Query) pattern.

The methods in this class provide an implementation of the standard query operators for querying data sources that implement Iterable. The standard query operators are general purpose methods that follow the LINQ pattern and enable you to express traversal, filter, and projection operations over data in JavaScript or any related programming languages (TypeScript, CoffeeScript, etc). Methods that are used in a query that returns a sequence of values do not consume the target data until the query object is enumerated. This is known as deferred execution. Methods that are used in a query that returns a singleton value execute and consume the target data immediately.

Name Description
Aggregate Applies an accumulator function over a sequence.
All Determines whether all elements of a sequence satisfy a condition.
Any Determines whether a sequence contains any elements.
AsEnumerable Returns the input typed as Iterable.
Average Computes the average of a sequence of Decimal values.
Cast Casts the elements of an IEnumerable to the specified type.
Concat Concatenates two sequences.
ChunkBy Group results by contiguous keys.
Contains Determines whether a sequence contains a specified element by using the default equality comparer.
Count Returns the number of elements in a sequence.
DefaultIfEmpty Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.
Distinct Returns distinct elements from a sequence by using the default equality comparer to compare values.
ElementAt Returns the element at a specified index in a sequence.
ElementAtOrDefault Returns the element at a specified index in a sequence or a default value if the index is out of range.
Except Produces the set difference of two sequences by using the default equality comparer to compare values.
First Returns the first element of a sequence.
FirstOrDefault Returns the first element of a sequence, or a default value if the sequence contains no elements.
GroupBy Groups the elements of a sequence according to a specified key selector function.
GroupJoin Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.
Intersect Produces the set intersection of two sequences by using the default equality comparer to compare values.
Join Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.
Last Returns the last element of a sequence.
LastOrDefault Returns the last element of a sequence, or a default value if the sequence contains no elements.
Max Returns the maximum value in a sequence of Decimal values.
Min Returns the minimum value in a sequence of Decimal values.
[OfType] (./oftype) Filters the elements of an IEnumerable based on a specified type.
[OrderBy] (./orderby) Sorts the elements of a sequence in ascending order according to a key.
[Range] (./range) Generates a sequence of integral numbers within a specified range.
[Repeat] (./repeat) Generates a sequence that contains one repeated value.
[Reverse] (./reverse) Inverts the order of the elements in a sequence.
[Select] (./select) Projects each element of a sequence into a new form.
[SelectMany] (./selectmany) Projects each element of a sequence to an Iterable, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element.
[SequenceEqual] (./sequenceequal) Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.
[Single] (./single) Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
[SingleOrDefault] (./singleordefault) Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
[Skip] (./skip) Bypasses a specified number of elements in a sequence and then returns the remaining elements.
[SkipWhile] (./skipwhile) Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
[Sum] (./sum) Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.
[Take] (./take) Returns a specified number of contiguous elements from the start of a sequence.
[TakeWhile] (./takewhile) Returns elements from a sequence as long as a specified condition is true.
[ThenBy] (./thenby) Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer.
[ThenByDescending] (./thenbydescending) Performs a subsequent ordering of the elements in a sequence in descending order, according to a key.
[ToArray] (./toarray) Creates an array from a Iterable.
[ToMap] (./todictionary) Creates a Map<TKey, TValue> from an Iterable according to a specified key selector function, a comparer, and an element selector function.
[Union] (./union) Produces the set union of two sequences by using a specified IEqualityComparer.
[Where] (./where) Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.
[Zip] (./zip) Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
Clone this wiki locally