Skip to content
Stuart Turner edited this page Feb 17, 2023 · 2 revisions

SuperLinq

Contents

Enumerator type

Namespace

SuperLinq.Collections.UpdatablePriorityQueue`2.UnorderedItemsCollection

Summary

Enumerates the element and priority pairs of a UpdatablePriorityQueue`2, without any ordering guarantees.

Current property

Summary

Gets the element at the current position of the enumerator.

Dispose() method

Summary

Releases all resources used by the Enumerator.

Parameters

This method has no parameters.

MoveNext() method

Summary

Advances the enumerator to the next element of the UnorderedItems.

Returns

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Parameters

This method has no parameters.

JoinType type

Namespace

SuperLinq

Summary

Values defining which type of join to use in join functions.

Hash constants

Summary

Build a ILookup`2 for one side to execute the join.

Loop constants

Summary

Use nested loops over the left and right inputs to execute the join.

Merge constants

Summary

Simultaneously enumerates both sequences to execute the join.

Remarks

A merge join assumes that the left and right inputs are already sorted. If they are not sorted, then the results will be undefined.

Lookup`2 type

Namespace

SuperLinq

Summary

A ILookup`2 implementation that preserves insertion order

Remarks

This implementation preserves insertion order of keys and elements within each IEnumerable`1. Copied and modified from Lookup.cs

NullKeyDictionary`2 type

Namespace

SuperLinq.Collections

Summary

A minimal Dictionary`2 wrapper that allows null keys when TKey is a reference type.

OrderByDirection type

Namespace

SuperLinq

Summary

Enumeration that defines values representing valid ordering directions for a sequence.

Ascending constants

Summary

Elements are ordered by increasing value

Descending constants

Summary

Elements are ordered by decreasing value

PerformanceSensitiveAttribute type

Namespace

Roslyn.Utilities

Summary

Indicates that a code element is performance sensitive under a known scenario.

Remarks

When applying this attribute, only explicitly set the values for properties specifically indicated by the test/measurement technique described in the associated Uri.

AllowCaptures property

Summary

Gets or sets a value indicating whether captures are allowed.

AllowGenericEnumeration property

Summary

Gets or sets a value indicating whether enumeration of a generic IEnumerable`1 is allowed.

AllowImplicitBoxing property

Summary

Gets or sets a value indicating whether implicit boxing of value types is allowed.

AllowLocks property

Summary

Gets or sets a value indicating whether locks are allowed.

Constraint property

Summary

Gets or sets a description of the constraint imposed by the original performance issue.

Remarks

Constraints are normally specified by other specific properties that allow automated validation of the constraint. This property supports documenting constraints which cannot be described in terms of other constraint properties.

IsParallelEntry property

Summary

Gets or sets a value indicating whether this is an entry point to a parallel algorithm.

Remarks

Parallelization APIs and algorithms, e.g. Parallel.ForEach, may be efficient for parallel entry points (few direct calls but large amounts of iterative work), but are problematic when called inside the iterations themselves. Performance-sensitive code should avoid the use of heavy parallelization APIs except for known entry points to the parallel portion of code.

OftenCompletesSynchronously property

Summary

Gets or sets a value indicating whether the asynchronous state machine typically completes synchronously.

Remarks

When true, validation of this performance constraint typically involves analyzing the method to ensure synchronous completion of the state machine does not require the allocation of a Task, either through caching the result or by using ValueTask`1.

Uri property

Summary

Gets the location where the original problem is documented, likely with steps to reproduce the issue and/or validate performance related to a change in the method.

PermutationEnumerator`1 type

Namespace

SuperLinq.SuperEnumerable

Summary

The private implementation class that produces permutations of a sequence.

NextPermutation() method

Summary

Transposes elements in the cached permutation array to produce the next permutation

Parameters

This method has no parameters.

PermuteValueSet() method

Summary

Creates a new list containing the values from the original set in their new permuted order.

Returns

List of permuted source sequence values

Parameters

This method has no parameters.

Remarks

The reason we return a new permuted value set, rather than reuse an existing collection, is that we have no control over what the consumer will do with the results produced. They could very easily generate and store a set of permutations and only then begin to process them. If we reused the same collection, the caller would be surprised to discover that all of the permutations looked the same.

SubsetEnumerator type

Namespace

SuperLinq.SuperEnumerable.SubsetGenerator`1

Summary

SubsetEnumerator uses a snapshot of the original sequence, and an iterative, reductive swap algorithm to produce all subsets of a predetermined size less than or equal to the original set size.

SubsetGenerator`1 type

Namespace

SuperLinq.SuperEnumerable

Summary

This class is responsible for producing the lexographically ordered k-subsets

GetEnumerator() method

Summary

Returns an enumerator that produces all of the k-sized subsets of the initial value set. The enumerator returns and IList`1 for each subset.

Returns

an IEnumerator that enumerates all k-sized subsets

Parameters

This method has no parameters.

SuperEnumerable type

Namespace

SuperLinq

Summary

Provides a set of static methods for querying objects that implement IEnumerable`1.

AggregateRight``1(source,func) method

Summary

Applies a right-associative accumulator function over a sequence. This operator is the right-associative version of the Aggregate``1 LINQ operator.

Returns

The final accumulator value.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence.
func System.Func{``0,``0,``0} A right-associative accumulator function to be invoked on each element.
Generic Types
Name Description
TSource The type of the elements of source.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException func is null.
Example
<![CDATA[
            string result = Enumerable.Range(1, 5).Select(i => i.ToString()).AggregateRight((a, b) => string.Format("({0}/{1})", a, b));
            ]]>

The result variable will contain "(1/(2/(3/(4/5))))".

Remarks

This operator executes immediately.

AggregateRight``2(source,seed,func) method

Summary

Applies a right-associative accumulator function over a sequence. The specified seed value is used as the initial accumulator value. This operator is the right-associative version of the Aggregate``2 LINQ operator.

Returns

The final accumulator value.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence.
seed ``1 The initial accumulator value.
func System.Func{``0,``1,``1} A right-associative accumulator function to be invoked on each element.
Generic Types
Name Description
TSource The type of the elements of source.
TAccumulate The type of the accumulator value.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException func is null.
Example
<![CDATA[
            var numbers = Enumerable.Range(1, 5);
            string result = numbers.AggregateRight("6", (a, b) => string.Format("({0}/{1})", a, b));
            ]]>

The result variable will contain "(1/(2/(3/(4/(5/6)))))".

Remarks

This operator executes immediately.

AggregateRight``3(source,seed,func,resultSelector) method

Summary

Applies a right-associative accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. This operator is the right-associative version of the Aggregate``3 LINQ operator.

Returns

The transformed final accumulator value.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence.
seed ``1 The initial accumulator value.
func System.Func{``0,``1,``1} A right-associative accumulator function to be invoked on each element.
resultSelector System.Func{``1,``2} A function to transform the final accumulator value into the result value.
Generic Types
Name Description
TSource The type of the elements of source.
TAccumulate The type of the accumulator value.
TResult The type of the resulting value.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException func is null.
System.ArgumentNullException resultSelector is null.
Example
<![CDATA[
            var numbers = Enumerable.Range(1, 5);
            int result = numbers.AggregateRight("6", (a, b) => string.Format("({0}/{1})", a, b), str => str.Length);
            ]]>

The result variable will contain 21.

Remarks

This operator executes immediately.

Aggregate``10(source,resultSelector,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5,seed6,accumulator6,seed7,accumulator7,seed8,accumulator8) method

Summary

Applies eight accumulators sequentially in a single pass over a sequence.

Returns

The value returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
resultSelector ``1 A function that projects a single result given the result of each accumulator.
seed1 System.Func{``1,``0,``1} The seed value for the first accumulator.
accumulator1 ``2 The first accumulator.
seed2 System.Func{``2,``0,``2} The seed value for the second accumulator.
accumulator2 ``3 The second accumulator.
seed3 System.Func{``3,``0,``3} The seed value for the third accumulator.
accumulator3 ``4 The third accumulator.
seed4 System.Func{``4,``0,``4} The seed value for the fourth accumulator.
accumulator4 ``5 The fourth accumulator.
seed5 System.Func{``5,``0,``5} The seed value for the fifth accumulator.
accumulator5 ``6 The fifth accumulator.
seed6 System.Func{``6,``0,``6} The seed value for the sixth accumulator.
accumulator6 ``7 The sixth accumulator.
seed7 System.Func{``7,``0,``7} The seed value for the seventh accumulator.
accumulator7 ``8 The seventh accumulator.
seed8 System.Func{``8,``0,``8} The seed value for the eighth accumulator.
accumulator8 System.Func{``1,``2,``3,``4,``5,``6,``7,``8,``9} The eighth accumulator.
Generic Types
Name Description
T The type of elements in source.
TResult The type of the accumulated result.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
TAccumulate6 The type of the sixth accumulator value.
TAccumulate7 The type of the seventh accumulator value.
TAccumulate8 The type of the eighth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``3(source,seed1,accumulator1,seed2,accumulator2) method

Summary

Applies two accumulators sequentially in a single pass over a sequence.

Returns

A ValueTuple`2 containing the result of each accumulator.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
seed1 ``1 The seed value for the first accumulator.
accumulator1 System.Func{``1,``0,``1} The first accumulator.
seed2 ``2 The seed value for the second accumulator.
accumulator2 System.Func{``2,``0,``2} The second accumulator.
Generic Types
Name Description
T The type of elements in source.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
Exceptions
Name Description
System.ArgumentNullException source or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``4(source,resultSelector,seed1,accumulator1,seed2,accumulator2) method

Summary

Applies two accumulators sequentially in a single pass over a sequence.

Returns

The value returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
resultSelector ``1 A function that projects a single result given the result of each accumulator.
seed1 System.Func{``1,``0,``1} The seed value for the first accumulator.
accumulator1 ``2 The first accumulator.
seed2 System.Func{``2,``0,``2} The seed value for the second accumulator.
accumulator2 System.Func{``1,``2,``3} The second accumulator.
Generic Types
Name Description
T The type of elements in source.
TResult The type of the accumulated result.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``4(source,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3) method

Summary

Applies three accumulators sequentially in a single pass over a sequence.

Returns

A ValueTuple`3 containing the result of each accumulator.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
seed1 ``1 The seed value for the first accumulator.
accumulator1 System.Func{``1,``0,``1} The first accumulator.
seed2 ``2 The seed value for the second accumulator.
accumulator2 System.Func{``2,``0,``2} The second accumulator.
seed3 ``3 The seed value for the third accumulator.
accumulator3 System.Func{``3,``0,``3} The third accumulator.
Generic Types
Name Description
T The type of elements in source.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
Exceptions
Name Description
System.ArgumentNullException source or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``5(source,resultSelector,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3) method

Summary

Applies three accumulators sequentially in a single pass over a sequence.

Returns

The value returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
resultSelector ``1 A function that projects a single result given the result of each accumulator.
seed1 System.Func{``1,``0,``1} The seed value for the first accumulator.
accumulator1 ``2 The first accumulator.
seed2 System.Func{``2,``0,``2} The seed value for the second accumulator.
accumulator2 ``3 The second accumulator.
seed3 System.Func{``3,``0,``3} The seed value for the third accumulator.
accumulator3 System.Func{``1,``2,``3,``4} The third accumulator.
Generic Types
Name Description
T The type of elements in source.
TResult The type of the accumulated result.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``5(source,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4) method

Summary

Applies four accumulators sequentially in a single pass over a sequence.

Returns

A ValueTuple`4 containing the result of each accumulator.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
seed1 ``1 The seed value for the first accumulator.
accumulator1 System.Func{``1,``0,``1} The first accumulator.
seed2 ``2 The seed value for the second accumulator.
accumulator2 System.Func{``2,``0,``2} The second accumulator.
seed3 ``3 The seed value for the third accumulator.
accumulator3 System.Func{``3,``0,``3} The third accumulator.
seed4 ``4 The seed value for the fourth accumulator.
accumulator4 System.Func{``4,``0,``4} The fourth accumulator.
Generic Types
Name Description
T The type of elements in source.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``6(source,resultSelector,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4) method

Summary

Applies four accumulators sequentially in a single pass over a sequence.

Returns

The value returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
resultSelector ``1 A function that projects a single result given the result of each accumulator.
seed1 System.Func{``1,``0,``1} The seed value for the first accumulator.
accumulator1 ``2 The first accumulator.
seed2 System.Func{``2,``0,``2} The seed value for the second accumulator.
accumulator2 ``3 The second accumulator.
seed3 System.Func{``3,``0,``3} The seed value for the third accumulator.
accumulator3 ``4 The third accumulator.
seed4 System.Func{``4,``0,``4} The seed value for the fourth accumulator.
accumulator4 System.Func{``1,``2,``3,``4,``5} The fourth accumulator.
Generic Types
Name Description
T The type of elements in source.
TResult The type of the accumulated result.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``6(source,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5) method

Summary

Applies five accumulators sequentially in a single pass over a sequence.

Returns

A ValueTuple`5 containing the result of each accumulator.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
seed1 ``1 The seed value for the first accumulator.
accumulator1 System.Func{``1,``0,``1} The first accumulator.
seed2 ``2 The seed value for the second accumulator.
accumulator2 System.Func{``2,``0,``2} The second accumulator.
seed3 ``3 The seed value for the third accumulator.
accumulator3 System.Func{``3,``0,``3} The third accumulator.
seed4 ``4 The seed value for the fourth accumulator.
accumulator4 System.Func{``4,``0,``4} The fourth accumulator.
seed5 ``5 The seed value for the fifth accumulator.
accumulator5 System.Func{``5,``0,``5} The fifth accumulator.
Generic Types
Name Description
T The type of elements in source.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``7(source,resultSelector,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5) method

Summary

Applies five accumulators sequentially in a single pass over a sequence.

Returns

The value returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
resultSelector ``1 A function that projects a single result given the result of each accumulator.
seed1 System.Func{``1,``0,``1} The seed value for the first accumulator.
accumulator1 ``2 The first accumulator.
seed2 System.Func{``2,``0,``2} The seed value for the second accumulator.
accumulator2 ``3 The second accumulator.
seed3 System.Func{``3,``0,``3} The seed value for the third accumulator.
accumulator3 ``4 The third accumulator.
seed4 System.Func{``4,``0,``4} The seed value for the fourth accumulator.
accumulator4 ``5 The fourth accumulator.
seed5 System.Func{``5,``0,``5} The seed value for the fifth accumulator.
accumulator5 System.Func{``1,``2,``3,``4,``5,``6} The fifth accumulator.
Generic Types
Name Description
T The type of elements in source.
TResult The type of the accumulated result.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``7(source,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5,seed6,accumulator6) method

Summary

Applies six accumulators sequentially in a single pass over a sequence.

Returns

A ValueTuple`6 containing the result of each accumulator.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
seed1 ``1 The seed value for the first accumulator.
accumulator1 System.Func{``1,``0,``1} The first accumulator.
seed2 ``2 The seed value for the second accumulator.
accumulator2 System.Func{``2,``0,``2} The second accumulator.
seed3 ``3 The seed value for the third accumulator.
accumulator3 System.Func{``3,``0,``3} The third accumulator.
seed4 ``4 The seed value for the fourth accumulator.
accumulator4 System.Func{``4,``0,``4} The fourth accumulator.
seed5 ``5 The seed value for the fifth accumulator.
accumulator5 System.Func{``5,``0,``5} The fifth accumulator.
seed6 ``6 The seed value for the sixth accumulator.
accumulator6 System.Func{``6,``0,``6} The sixth accumulator.
Generic Types
Name Description
T The type of elements in source.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
TAccumulate6 The type of the sixth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``8(source,resultSelector,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5,seed6,accumulator6) method

Summary

Applies six accumulators sequentially in a single pass over a sequence.

Returns

The value returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
resultSelector ``1 A function that projects a single result given the result of each accumulator.
seed1 System.Func{``1,``0,``1} The seed value for the first accumulator.
accumulator1 ``2 The first accumulator.
seed2 System.Func{``2,``0,``2} The seed value for the second accumulator.
accumulator2 ``3 The second accumulator.
seed3 System.Func{``3,``0,``3} The seed value for the third accumulator.
accumulator3 ``4 The third accumulator.
seed4 System.Func{``4,``0,``4} The seed value for the fourth accumulator.
accumulator4 ``5 The fourth accumulator.
seed5 System.Func{``5,``0,``5} The seed value for the fifth accumulator.
accumulator5 ``6 The fifth accumulator.
seed6 System.Func{``6,``0,``6} The seed value for the sixth accumulator.
accumulator6 System.Func{``1,``2,``3,``4,``5,``6,``7} The sixth accumulator.
Generic Types
Name Description
T The type of elements in source.
TResult The type of the accumulated result.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
TAccumulate6 The type of the sixth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``8(source,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5,seed6,accumulator6,seed7,accumulator7) method

Summary

Applies seven accumulators sequentially in a single pass over a sequence.

Returns

A ValueTuple`7 containing the result of each accumulator.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
seed1 ``1 The seed value for the first accumulator.
accumulator1 System.Func{``1,``0,``1} The first accumulator.
seed2 ``2 The seed value for the second accumulator.
accumulator2 System.Func{``2,``0,``2} The second accumulator.
seed3 ``3 The seed value for the third accumulator.
accumulator3 System.Func{``3,``0,``3} The third accumulator.
seed4 ``4 The seed value for the fourth accumulator.
accumulator4 System.Func{``4,``0,``4} The fourth accumulator.
seed5 ``5 The seed value for the fifth accumulator.
accumulator5 System.Func{``5,``0,``5} The fifth accumulator.
seed6 ``6 The seed value for the sixth accumulator.
accumulator6 System.Func{``6,``0,``6} The sixth accumulator.
seed7 ``7 The seed value for the seventh accumulator.
accumulator7 System.Func{``7,``0,``7} The seventh accumulator.
Generic Types
Name Description
T The type of elements in source.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
TAccumulate6 The type of the sixth accumulator value.
TAccumulate7 The type of the seventh accumulator value.
Exceptions
Name Description
System.ArgumentNullException source or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``9(source,resultSelector,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5,seed6,accumulator6,seed7,accumulator7) method

Summary

Applies seven accumulators sequentially in a single pass over a sequence.

Returns

The value returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
resultSelector ``1 A function that projects a single result given the result of each accumulator.
seed1 System.Func{``1,``0,``1} The seed value for the first accumulator.
accumulator1 ``2 The first accumulator.
seed2 System.Func{``2,``0,``2} The seed value for the second accumulator.
accumulator2 ``3 The second accumulator.
seed3 System.Func{``3,``0,``3} The seed value for the third accumulator.
accumulator3 ``4 The third accumulator.
seed4 System.Func{``4,``0,``4} The seed value for the fourth accumulator.
accumulator4 ``5 The fourth accumulator.
seed5 System.Func{``5,``0,``5} The seed value for the fifth accumulator.
accumulator5 ``6 The fifth accumulator.
seed6 System.Func{``6,``0,``6} The seed value for the sixth accumulator.
accumulator6 ``7 The sixth accumulator.
seed7 System.Func{``7,``0,``7} The seed value for the seventh accumulator.
accumulator7 System.Func{``1,``2,``3,``4,``5,``6,``7,``8} The seventh accumulator.
Generic Types
Name Description
T The type of elements in source.
TResult The type of the accumulated result.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
TAccumulate6 The type of the sixth accumulator value.
TAccumulate7 The type of the seventh accumulator value.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector or any of the accumulator functions is null.
Remarks

This operator executes immediately.

Aggregate``9(source,seed1,accumulator1,seed2,accumulator2,seed3,accumulator3,seed4,accumulator4,seed5,accumulator5,seed6,accumulator6,seed7,accumulator7,seed8,accumulator8) method

Summary

Applies eight accumulators sequentially in a single pass over a sequence.

Returns

A ValueTuple`8 containing the result of each accumulator.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
seed1 ``1 The seed value for the first accumulator.
accumulator1 System.Func{``1,``0,``1} The first accumulator.
seed2 ``2 The seed value for the second accumulator.
accumulator2 System.Func{``2,``0,``2} The second accumulator.
seed3 ``3 The seed value for the third accumulator.
accumulator3 System.Func{``3,``0,``3} The third accumulator.
seed4 ``4 The seed value for the fourth accumulator.
accumulator4 System.Func{``4,``0,``4} The fourth accumulator.
seed5 ``5 The seed value for the fifth accumulator.
accumulator5 System.Func{``5,``0,``5} The fifth accumulator.
seed6 ``6 The seed value for the sixth accumulator.
accumulator6 System.Func{``6,``0,``6} The sixth accumulator.
seed7 ``7 The seed value for the seventh accumulator.
accumulator7 System.Func{``7,``0,``7} The seventh accumulator.
seed8 ``8 The seed value for the eighth accumulator.
accumulator8 System.Func{``8,``0,``8} The eighth accumulator.
Generic Types
Name Description
T The type of elements in source.
TAccumulate1 The type of the first accumulator value.
TAccumulate2 The type of the second accumulator value.
TAccumulate3 The type of the third accumulator value.
TAccumulate4 The type of the fourth accumulator value.
TAccumulate5 The type of the fifth accumulator value.
TAccumulate6 The type of the sixth accumulator value.
TAccumulate7 The type of the seventh accumulator value.
TAccumulate8 The type of the eighth accumulator value.
Exceptions
Name Description
System.ArgumentNullException source or any of the accumulator functions is null.
Remarks

This operator executes immediately.

AssertCount``1(source,count) method

Summary

Asserts that a source sequence contains a given count of elements.

Returns

Returns the original sequence as long it is contains the number of elements specified by count. Otherwise it throws ArgumentException.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence.
count System.Int32 Count to assert.
Generic Types
Name Description
TSource Type of elements in source sequence.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException count is less than 0.
System.ArgumentException source has a length different than count.
Remarks

This operator uses deferred execution and streams its results.

AtLeast``1(source,count) method

Summary

Determines whether or not the number of elements in the sequence is greater than or equal to the given integer.

Returns

true if the number of elements in the sequence is greater than or equal to the given integer or false otherwise.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
count System.Int32 The minimum number of items a sequence must have for this
function to return true
Generic Types
Name Description
T Element type of sequence
Exceptions
Name Description
System.ArgumentNullException source is null
System.ArgumentOutOfRangeException count is negative
Example
<![CDATA[
            var numbers = new[] { 123, 456, 789 };
            var result = numbers.AtLeast(2);
            ]]>

The result variable will contain true.

AtMost``1(source,count) method

Summary

Determines whether or not the number of elements in the sequence is lesser than or equal to the given integer.

Returns

true if the number of elements in the sequence is lesser than or equal to the given integer or false otherwise.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
count System.Int32 The maximum number of items a sequence must have for this
function to return true
Generic Types
Name Description
T Element type of sequence
Exceptions
Name Description
System.ArgumentNullException source is null
System.ArgumentOutOfRangeException count is negative
Example
<![CDATA[
            var numbers = new[] { 123, 456, 789 };
            var result = numbers.AtMost(2);
            ]]>

The result variable will contain false.

Backsert``1(first,second,index) method

Summary

Inserts the elements of a sequence into another sequence at a specified index from the tail of the sequence, where zero always represents the last position, one represents the second-last element, two represents the third-last element and so on.

Returns

A sequence that contains the elements of first plus the elements of second inserted at the given index from the end of first.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The source sequence.
second System.Collections.Generic.IEnumerable{``0} The sequence that will be inserted.
index System.Int32 The zero-based index from the end of first where
elements from second should be inserted.
second.
Generic Types
Name Description
T Type of elements in all sequences.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
System.ArgumentOutOfRangeException Thrown if index is negative.
System.ArgumentOutOfRangeException Thrown lazily if index is greater than the
length of first. The validation occurs when
the resulting sequence is iterated.
Remarks

This method uses deferred execution and streams its results.

Batch``1(source,size) method

Summary

Split the elements of a sequence into chunks of size at most size.

Returns

An IEnumerable`1 that contains the elements the input sequence split into chunks of size size.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 whose elements to chunk.
size System.Int32 The maximum size of each chunk.
Generic Types
Name Description
TSource The type of the elements of source.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException size is below 1.

Batch``2(source,size,resultSelector) method

Summary

Split the elements of a sequence into chunks of size at most size.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 whose elements to chunk.
size System.Int32 The maximum size of each chunk.
resultSelector System.Func{System.Collections.Generic.IReadOnlyList{``0},``1} A transform function to apply to each chunk.
Generic Types
Name Description
TSource The type of the elements of source.
TResult The type of the value return by resultSelector.
Exceptions
Name Description
System.ArgumentNullException source or resultSelector is
null.
System.ArgumentOutOfRangeException size is below 1.
Remarks

A chunk can contain fewer elements than size, specifically the final chunk of source.

In this overload of Batch, a single array of length size is allocated as a buffer for all subsequences.

This operator uses deferred execution and streams its results.

Batch``2(source,array,resultSelector) method

Summary

Split the elements of a sequence into chunks of size at most .Length.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 whose elements to chunk.
array ``0[] An array to use as a buffer for each chunk.
resultSelector System.Func{System.Collections.Generic.IReadOnlyList{``0},``1} A transform function to apply to each chunk.
Generic Types
Name Description
TSource The type of the elements of source.
TResult The type of the value return by resultSelector.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector, or
array is null.
Remarks

A chunk can contain fewer elements than .Length, specifically the final chunk of source.

In this overload of Batch, array is used as a common buffer for all subsequences.

This operator uses deferred execution and streams its results.

Batch``2(source,size,array,resultSelector) method

Summary

Split the elements of a sequence into chunks of size at most size.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 whose elements to chunk.
size ``0[] The maximum size of each chunk.
array System.Int32 An array to use as a buffer for each chunk.
resultSelector System.Func{System.Collections.Generic.IReadOnlyList{``0},``1} A transform function to apply to each chunk.
Generic Types
Name Description
TSource The type of the elements of source.
TResult The type of the value return by resultSelector.
Exceptions
Name Description
System.ArgumentNullException source, resultSelector, or
array is null.
System.ArgumentOutOfRangeException size is below 1 or above .Length.
Remarks

A chunk can contain fewer elements than size, specifically the final chunk of source.

In this overload of Batch, array is used as a common buffer for all subsequences. This overload is provided to ease usage of common buffers, such as those rented from ArrayPool`1, which may return an array larger than requested.

This operator uses deferred execution and streams its results.

BindByIndex``1(source,indices) method

Summary

Selects elements by index from a sequence.

Returns

An IEnumerable`1 whose elements are the result of selecting elements according to the indices sequence.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
indices System.Collections.Generic.IEnumerable{System.Int32} The list of indices of elements in the source sequence to select.
Generic Types
Name Description
TSource The type of the elements of source.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException indices is null.
System.ArgumentOutOfRangeException An index in indices is out of range for the input sequence source.

BindByIndex``2(source,indices,resultSelector,missingSelector) method

Summary

Selects elements by index from a sequence and transforms them using the provided functions.

Returns

An IEnumerable`1 whose elements are the result of selecting elements according to the indices sequence and invoking the transform function.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
indices System.Collections.Generic.IEnumerable{System.Int32} The list of indices of elements in the source sequence to select.
resultSelector System.Func{``0,System.Int32,``1} A transform function to apply to each source element; the second parameter of the function represents the index of the output sequence.
missingSelector System.Func{System.Int32,``1} A transform function to apply to missing source elements; the parameter represents the index of the output sequence.
Generic Types
Name Description
TSource The type of the elements of source.
TResult The type of the elements of the resulting sequence.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException indices is null.
System.ArgumentNullException resultSelector is null.
System.ArgumentNullException missingSelector is null.
Remarks

This method uses deferred execution and streams its results.

BuildOrBindSchema() method

Parameters

This method has no parameters.

Remarks

The resulting array may contain null entries and those represent columns for which there is no source member supplying a value.

Cartesian``2(first,second) method

Summary

Returns the Cartesian product of two sequences by enumerating all possible combinations of one item from each sequence.

Returns

A sequence of ValueTuple`2 containing elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
Generic Types
Name Description
T1 The type of the elements of first.
T2 The type of the elements of second.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences are cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``3(resultSelector,first,second) method

Summary

Returns the Cartesian product of two sequences by enumerating all possible combinations of one item from each sequence, and applying a user-defined projection to the items in a given combination.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Func{``0,``1,``2} The second sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
T1 The type of the elements of first.
T2 The type of the elements of second.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``3(first,second,third) method

Summary

Returns the Cartesian product of three sequences by enumerating all possible combinations of one item from each sequence.

Returns

A sequence of ValueTuple`3 containing elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
Generic Types
Name Description
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences are cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``4(resultSelector,first,second,third) method

Summary

Returns the Cartesian product of three sequences by enumerating all possible combinations of one item from each sequence, and applying a user-defined projection to the items in a given combination.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Func{``0,``1,``2,``3} The third sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``4(first,second,third,fourth) method

Summary

Returns the Cartesian product of four sequences by enumerating all possible combinations of one item from each sequence.

Returns

A sequence of ValueTuple`4 containing elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``3} The fourth sequence of elements.
Generic Types
Name Description
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences are cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``5(resultSelector,first,second,third,fourth) method

Summary

Returns the Cartesian product of four sequences by enumerating all possible combinations of one item from each sequence, and applying a user-defined projection to the items in a given combination.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``3} The third sequence of elements.
fourth System.Func{``0,``1,``2,``3,``4} The fourth sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``5(first,second,third,fourth,fifth) method

Summary

Returns the Cartesian product of five sequences by enumerating all possible combinations of one item from each sequence.

Returns

A sequence of ValueTuple`5 containing elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``3} The fourth sequence of elements.
fifth System.Collections.Generic.IEnumerable{``4} The fifth sequence of elements.
Generic Types
Name Description
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences are cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``6(resultSelector,first,second,third,fourth,fifth) method

Summary

Returns the Cartesian product of five sequences by enumerating all possible combinations of one item from each sequence, and applying a user-defined projection to the items in a given combination.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``3} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``4} The fourth sequence of elements.
fifth System.Func{``0,``1,``2,``3,``4,``5} The fifth sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``6(first,second,third,fourth,fifth,sixth) method

Summary

Returns the Cartesian product of six sequences by enumerating all possible combinations of one item from each sequence.

Returns

A sequence of ValueTuple`6 containing elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``3} The fourth sequence of elements.
fifth System.Collections.Generic.IEnumerable{``4} The fifth sequence of elements.
sixth System.Collections.Generic.IEnumerable{``5} The sixth sequence of elements.
Generic Types
Name Description
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
T6 The type of the elements of sixth.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences are cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``7(resultSelector,first,second,third,fourth,fifth,sixth) method

Summary

Returns the Cartesian product of six sequences by enumerating all possible combinations of one item from each sequence, and applying a user-defined projection to the items in a given combination.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``3} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``4} The fourth sequence of elements.
fifth System.Collections.Generic.IEnumerable{``5} The fifth sequence of elements.
sixth System.Func{``0,``1,``2,``3,``4,``5,``6} The sixth sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
T6 The type of the elements of sixth.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``7(first,second,third,fourth,fifth,sixth,seventh) method

Summary

Returns the Cartesian product of seven sequences by enumerating all possible combinations of one item from each sequence.

Returns

A sequence of ValueTuple`7 containing elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``3} The fourth sequence of elements.
fifth System.Collections.Generic.IEnumerable{``4} The fifth sequence of elements.
sixth System.Collections.Generic.IEnumerable{``5} The sixth sequence of elements.
seventh System.Collections.Generic.IEnumerable{``6} The seventh sequence of elements.
Generic Types
Name Description
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
T6 The type of the elements of sixth.
T7 The type of the elements of seventh.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences are cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``8(resultSelector,first,second,third,fourth,fifth,sixth,seventh) method

Summary

Returns the Cartesian product of seven sequences by enumerating all possible combinations of one item from each sequence, and applying a user-defined projection to the items in a given combination.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``3} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``4} The fourth sequence of elements.
fifth System.Collections.Generic.IEnumerable{``5} The fifth sequence of elements.
sixth System.Collections.Generic.IEnumerable{``6} The sixth sequence of elements.
seventh System.Func{``0,``1,``2,``3,``4,``5,``6,``7} The seventh sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
T6 The type of the elements of sixth.
T7 The type of the elements of seventh.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``8(first,second,third,fourth,fifth,sixth,seventh,eighth) method

Summary

Returns the Cartesian product of eight sequences by enumerating all possible combinations of one item from each sequence.

Returns

A sequence of ValueTuple`8 containing elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``3} The fourth sequence of elements.
fifth System.Collections.Generic.IEnumerable{``4} The fifth sequence of elements.
sixth System.Collections.Generic.IEnumerable{``5} The sixth sequence of elements.
seventh System.Collections.Generic.IEnumerable{``6} The seventh sequence of elements.
eighth System.Collections.Generic.IEnumerable{``7} The eighth sequence of elements.
Generic Types
Name Description
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
T6 The type of the elements of sixth.
T7 The type of the elements of seventh.
T8 The type of the elements of eighth.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences are cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Cartesian``9(resultSelector,first,second,third,fourth,fifth,sixth,seventh,eighth) method

Summary

Returns the Cartesian product of eight sequences by enumerating all possible combinations of one item from each sequence, and applying a user-defined projection to the items in a given combination.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``3} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``4} The fourth sequence of elements.
fifth System.Collections.Generic.IEnumerable{``5} The fifth sequence of elements.
sixth System.Collections.Generic.IEnumerable{``6} The sixth sequence of elements.
seventh System.Collections.Generic.IEnumerable{``7} The seventh sequence of elements.
eighth System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8} The eighth sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
T1 The type of the elements of first.
T2 The type of the elements of second.
T3 The type of the elements of third.
T4 The type of the elements of fourth.
T5 The type of the elements of fifth.
T6 The type of the elements of sixth.
T7 The type of the elements of seventh.
T8 The type of the elements of eighth.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
Remarks

The method returns items in the same order as a nested foreach loop, but all sequences cached when iterated over. The cache is then re-used for any subsequent iterations.

This method uses deferred execution and stream its results.

Choose``2(source,chooser) method

Summary

Applies a function to each element of the source sequence and returns a new sequence of result elements for source elements where the function returns a couple (2-tuple) having a true as its first element and result as the second.

Returns

A sequence TResult elements.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
chooser System.Func{``0,System.ValueTuple{System.Boolean,``1}} The function that is applied to each source
element.
Generic Types
Name Description
T The type of the elements in source.
TResult The type of the elements in the returned sequence.
Example
<![CDATA[
            var str = "O,l,2,3,4,S,6,7,B,9";
            var xs = str.Split(',').Choose(s => (int.TryParse(s, out var n), n));
            ]]>

The xs variable will be a sequence of the integers 2, 3, 4, 6, 7 and 9.

Remarks

This method uses deferred execution semantics and streams its results.

CollectionEqual``1(first,second) method

Summary

Determines whether two collections are equal by comparing the elements by using the default equality comparer for their type.

Returns

true if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 to compare to second.
second System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 to compare to the first sequence.
Generic Types
Name Description
TSource The type of the elements of the input sequences.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
Remarks

This method uses the default equality comparer for TSource, Default, determine whether two sequences have the same collection of elements. A collection may have more than one of the same element, so this method will compare the value and count of each element between both sequences.

This method executes immediately.

CollectionEqual``1(first,second,comparer) method

Summary

Determines whether two collections are equal by comparing the elements by using a specified IEqualityComparer`1.

Returns

true if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 to compare to second.
second System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 to compare to the first sequence.
comparer System.Collections.Generic.IEqualityComparer{``0} An IEqualityComparer`1 to use to compare elements.
Generic Types
Name Description
TSource The type of the elements of the input sequences.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
Remarks

This method uses the provided equality comparer for TSource to determine whether two sequences have the same collection of elements. A collection may have more than one of the same element, so this method will compare the value and count of each element between both sequences. If comparer is null, the default equality comparer, Default, is used.

This method executes immediately.

CompareCount``2(first,second) method

Summary

Compares two sequences and returns an integer that indicates whether the first sequence has fewer, the same or more elements than the second sequence.

Returns

-1 if the first sequence has the fewest elements, 0 if the two sequences have the same number of elements or 1 if the first sequence has the most elements.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence
second System.Collections.Generic.IEnumerable{``1} The second sequence
Generic Types
Name Description
TFirst Element type of the first sequence
TSecond Element type of the second sequence
Exceptions
Name Description
System.ArgumentNullException first is null
System.ArgumentNullException second is null
Example
<![CDATA[
            var first = new[] { 123, 456 };
            var second = new[] { 789 };
            var result = first.CompareCount(second);
            ]]>

The result variable will contain 1.

Consume``1(source) method

Summary

Completely consumes the given sequence. This method uses immediate execution, and doesn't store any data during execution.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source to consume
Generic Types
Name Description
T Element type of the sequence

CopyTo``1(source,span) method

Summary

Copies the contents of a sequence into a provided span.

Returns

The number of elements actually copied.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
span System.Span{``0} The span that is the destination of the elements copied from source.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentException span is not long enough to hold the data from
sequence.
Remarks

All data from source will be copied to span if possible. If source is shorter than span, then any remaining elements will be untouched. If source is longer than span, then an exception will be thrown.

This operator executes immediately.

CopyTo``1(source,array) method

Summary

Copies the contents of a sequence into a provided span.

Returns

The number of elements actually copied.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
array ``0[] The span that is the destination of the elements copied from source.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentException array is not long enough to hold the data from
sequence.
Remarks

All data from source will be copied to array if possible. If source is shorter than array, then any remaining elements will be untouched. If source is longer than array, then an exception will be thrown.

This operator executes immediately.

CopyTo``1(source,list) method

Summary

Copies the contents of a sequence into a provided list.

Returns

The number of elements actually copied.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
list System.Collections.Generic.IList{``0} The list that is the destination of the elements copied from source.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException list is null.
Remarks

All data from source will be copied to list, starting at position 0.

This operator executes immediately.

CopyTo``1(source,list,index) method

Summary

Copies the contents of a sequence into a provided list.

Returns

The number of elements actually copied.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
list System.Collections.Generic.IList{``0} The list that is the destination of the elements copied from source.
index System.Int32 The position in list at which to start copying data
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException list is null.
Remarks

All data from source will be copied to list, starting at position index.

This operator executes immediately.

CountBetween``1(source,min,max) method

Summary

Determines whether or not the number of elements in the sequence is between an inclusive range of minimum and maximum integers.

Returns

true if the number of elements in the sequence is between (inclusive) the min and max given integers or false otherwise.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
min System.Int32 The minimum number of items a sequence must have for this
function to return true
max System.Int32 The maximum number of items a sequence must have for this
function to return true
Generic Types
Name Description
T Element type of sequence
Exceptions
Name Description
System.ArgumentNullException source is null
System.ArgumentOutOfRangeException min is negative or max is less than min
Example
<![CDATA[
            var numbers = new[] { 123, 456, 789 };
            var result = numbers.CountBetween(1, 2);
            ]]>

The result variable will contain false.

CountBy``2(source,keySelector) method

Summary

Applies a key-generating function to each element of a sequence and returns a sequence of unique keys and their number of occurrences in the original sequence.

Returns

A sequence of unique keys and their number of occurrences in the original sequence.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence.
keySelector System.Func{``0,``1} Function that transforms each item of source sequence into a key to be compared against the others.
Generic Types
Name Description
TSource Type of the elements of the source sequence.
TKey Type of the projected element.

CountBy``2(source,keySelector,comparer) method

Summary

Applies a key-generating function to each element of a sequence and returns a sequence of unique keys and their number of occurrences in the original sequence. An additional argument specifies a comparer to use for testing equivalence of keys.

Returns

A sequence of unique keys and their number of occurrences in the original sequence.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence.
keySelector System.Func{``0,``1} Function that transforms each item of source sequence into a key to be compared against the others.
comparer System.Collections.Generic.IEqualityComparer{``1} The equality comparer to use to determine whether or not keys are equal.
If null, the default equality comparer for TSource is used.
Generic Types
Name Description
TSource Type of the elements of the source sequence.
TKey Type of the projected element.

CountDown``1(source,count) method

Summary

Provides a countdown counter for a given count of elements at the tail of the sequence where zero always represents the last element, one represents the second-last element, two represents the third-last element and so on.

Returns

A sequence of tuples of the element and it's count from the end of the sequence.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
count System.Int32 Count of tail elements of source to count down.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException count is 0 or negative.
Remarks

This method uses deferred execution semantics and streams its results. At most, count elements of the source sequence may be buffered at any one time unless source is a collection or a list.

This operator executes immediately.

CountDown``2(source,count,resultSelector) method

Summary

Provides a countdown counter for a given count of elements at the tail of the sequence where zero always represents the last element, one represents the second-last element, two represents the third-last element and so on.

Returns

A sequence of results returned by resultSelector.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
count System.Int32 Count of tail elements of source to count down.
resultSelector System.Func{``0,System.Nullable{System.Int32},``1} A function that receives the element and the current countdown value for the element and which returns those
mapped to a result returned in the resulting sequence. For elements before the last count,
the countdown value is null.
Generic Types
Name Description
TSource The type of elements of source
TResult The type of elements of the resulting sequence.
Exceptions
Name Description
System.ArgumentNullException source or resultSelector is null.
System.ArgumentOutOfRangeException count is 0 or negative.
Remarks

This method uses deferred execution semantics and streams its results. At most, count elements of the source sequence may be buffered at any one time unless source is a collection or a list.

This operator executes immediately.

DensePartialSortBy``2(source,keySelector,count) method

Summary

Executes a partial sort of the top count elements of a sequence, including ties, according to the key for each element. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in ascending order of their keys.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
keySelector System.Int32 A function to extract a key from an element.
count System.Func{``0,``1} Number of (maximum) elements to return.
Generic Types
Name Description
TSource Type of elements in the sequence.
TKey Type of keys.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DensePartialSortBy``2(source,keySelector,count,direction) method

Summary

Executes a direction partial sort of the top count elements of a sequence, including ties, according to the key for each element. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in the specified order of their keys.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
keySelector System.Int32 A function to extract a key from an element.
count System.Func{``0,``1} Number of (maximum) elements to return.
direction SuperLinq.OrderByDirection The direction in which to sort the elements
Generic Types
Name Description
TSource Type of elements in the sequence.
TKey Type of keys.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DensePartialSortBy``2(source,keySelector,count,comparer) method

Summary

Executes a partial sort of the top count elements of a sequence, including ties, according to the key for each element, using comparer to compare the keys. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in ascending order of their keys.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
keySelector System.Int32 A function to extract a key from an element.
count System.Func{``0,``1} Number of (maximum) elements to return.
comparer System.Collections.Generic.IComparer{``1} A IComparer`1 to compare elements.
Generic Types
Name Description
TSource Type of elements in the sequence.
TKey Type of keys.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DensePartialSortBy``2(source,keySelector,count,comparer,direction) method

Summary

Executes a direction partial sort of the top count elements of a sequence, including ties, according to the key for each element, using comparer to compare the keys. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in the specified order of their keys.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
keySelector System.Int32 A function to extract a key from an element.
count System.Func{``0,``1} Number of (maximum) elements to return.
comparer System.Collections.Generic.IComparer{``1} A IComparer`1 to compare elements.
direction SuperLinq.OrderByDirection The direction in which to sort the elements
Generic Types
Name Description
TSource Type of elements in the sequence.
TKey Type of keys.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DensePartialSort``1(source,count) method

Summary

Executes a partial sort of the top count elements of a sequence, including ties. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in their ascending order.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
count System.Int32 Number of (maximum) elements to return.
Generic Types
Name Description
T Type of elements in the sequence.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DensePartialSort``1(source,count,direction) method

Summary

Executes a direction partial sort of the top count elements of a sequence, including ties. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in the specified order.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
count System.Int32 Number of (maximum) elements to return.
direction SuperLinq.OrderByDirection The direction in which to sort the elements
Generic Types
Name Description
T Type of elements in the sequence.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DensePartialSort``1(source,count,comparer) method

Summary

Executes a partial sort of the top count elements of a sequence, including ties, using comparer to compare elements. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in their ascending order.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
count System.Int32 Number of (maximum) elements to return.
comparer System.Collections.Generic.IComparer{``0} A IComparer`1 to compare elements.
Generic Types
Name Description
T Type of elements in the sequence.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DensePartialSort``1(source,count,comparer,direction) method

Summary

Executes a direction partial sort of the top count elements of a sequence, including ties, using comparer to compare elements. If count is less than the total number of elements in source, then this method will improve performance.

Returns

A sequence containing at most top count elements from source, in the specified order.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
count System.Int32 Number of (maximum) elements to return.
comparer System.Collections.Generic.IComparer{``0} A IComparer`1 to compare elements.
direction SuperLinq.OrderByDirection The direction in which to sort the elements
Generic Types
Name Description
T Type of elements in the sequence.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException count is less than 1.
Remarks

This operation is an O(n * log(K)) where K is count.

This operator uses deferred execution and streams it results.

DenseRankBy``2(source,keySelector) method

Summary

Ranks each item in the sequence in ascending order by a specified key using a default comparer, with no gaps in the ranking values. The rank of a specific item is one plus the number of distinct rank values that come before that specific item.

Returns

A sorted sequence of items and their rank.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to rank
keySelector System.Func{``0,``1} A key selector function which returns the value by which to rank items in the sequence
Generic Types
Name Description
TSource The type of the elements in the source sequence
TKey The type of the key used to rank items in the sequence
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.

DenseRankBy``2(source,keySelector,comparer) method

Summary

Ranks each item in the sequence in ascending order by a specified key using a caller-supplied comparer, with no gaps in the ranking values. The rank of a specific item is one plus the number of distinct rank values that come before that specific item.

Returns

A sorted sequence of items and their rank.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to rank
keySelector System.Func{``0,``1} A key selector function which returns the value by which to rank items in the sequence
comparer System.Collections.Generic.IComparer{``1} An object that defines the comparison semantics for keys used to rank items
Generic Types
Name Description
TSource The type of the elements in the source sequence
TKey The type of the key used to rank items in the sequence
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.

DenseRank``1(source) method

Summary

Ranks each item in the sequence in ascending order using a default comparer, with no gaps in the ranking values. The rank of a specific item is one plus the number of distinct rank values that come before that specific item.

Returns

A sorted sequence of items and their rank.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence whose items will be ranked
Generic Types
Name Description
TSource Type of item in the sequence
Exceptions
Name Description
System.ArgumentNullException source is null.

DenseRank``1(source,comparer) method

Summary

Ranks each item in the sequence in ascending order using a caller-supplied comparer, with no gaps in the ranking values. The rank of a specific item is one plus the number of distinct rank values that come before that specific item.

Returns

A sorted sequence of items and their rank.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to rank
comparer System.Collections.Generic.IComparer{``0} A object that defines comparison semantics for the elements in the sequence
Generic Types
Name Description
TSource The type of the elements in the source sequence
Exceptions
Name Description
System.ArgumentNullException source is null.

DistinctBy``2(source,keySelector) method

Summary

Returns all distinct elements of the given source, where "distinctness" is determined via a projection and the default equality comparer for the projected type.

Returns

A sequence consisting of distinct elements from the source sequence, comparing them by the specified key projection.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence
keySelector System.Func{``0,``1} Projection for determining "distinctness"
Generic Types
Name Description
TSource Type of the source sequence
TKey Type of the projected element
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.
Remarks

This operator uses deferred execution and streams the results, although a set of already-seen keys is retained. If a key is seen multiple times, only the first element with that key is returned.

DistinctBy``2(source,keySelector,comparer) method

Summary

Returns all distinct elements of the given source, where "distinctness" is determined via a projection and the specified comparer for the projected type.

Returns

A sequence consisting of distinct elements from the source sequence, comparing them by the specified key projection.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} Source sequence
keySelector System.Func{``0,``1} Projection for determining "distinctness"
comparer System.Collections.Generic.IEqualityComparer{``1} The equality comparer to use to determine whether or not keys are equal.
If null, the default equality comparer for TSource is used.
Generic Types
Name Description
TSource Type of the source sequence
TKey Type of the projected element
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException keySelector is null.
Remarks

This operator uses deferred execution and streams the results, although a set of already-seen keys is retained. If a key is seen multiple times, only the first element with that key is returned.

ElementAtOrDefault``1(source,index) method

Summary

Returns the element at a specified index in a sequence or a default value if the index is out of range.

Returns

default if index is outside the bounds of the source sequence; otherwise, the element at the specified position in the source sequence.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 to return an element from.
index System.Index The index of the element to retrieve, which is either from the start or the end.
Generic Types
Name Description
TSource The type of the elements of source.
Exceptions
Name Description
System.ArgumentNullException source is null.
Remarks

If the type of source implements IList`1, that implementation is used to obtain the element at the specified index. Otherwise, this method obtains the specified element.

The default value for reference and nullable types is null.

ElementAt``1(source,index) method

Summary

Returns the element at a specified index in a sequence.

Returns

The element at the specified position in the source sequence.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} An IEnumerable`1 to return an element from.
index System.Index The index of the element to retrieve, which is either from the start or the end.
Generic Types
Name Description
TSource The type of the elements of source.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentOutOfRangeException index is outside the bounds of the source sequence.
Remarks

If the type of source implements IList`1, that implementation is used to obtain the element at the specified index. Otherwise, this method obtains the specified element.

This method throws an exception if index is out of range. To instead return a default value when the specified index is out of range, use the ElementAtOrDefault``1 method.

EndsWith``1(first,second) method

Summary

Determines whether the end of the first sequence is equivalent to the second sequence, using the default equality comparer.

Returns

true if first ends with elements equivalent to second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The sequence to check.
second System.Collections.Generic.IEnumerable{``0} The sequence to compare to.
Generic Types
Name Description
T Type of elements.
Remarks

This is the IEnumerable`1 equivalent of EndsWith and it calls Equals using Default on pairs of elements at the same index.

EndsWith``1(first,second,comparer) method

Summary

Determines whether the end of the first sequence is equivalent to the second sequence, using the specified element equality comparer.

Returns

true if first ends with elements equivalent to second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The sequence to check.
second System.Collections.Generic.IEnumerable{``0} The sequence to compare to.
comparer System.Collections.Generic.IEqualityComparer{``0} Equality comparer to use.
Generic Types
Name Description
T Type of elements.
Remarks

This is the IEnumerable`1 equivalent of EndsWith and it calls Equals on pairs of elements at the same index.

EquiZip``2(first,second) method

Summary

Joins the corresponding elements of second sequences, producing a sequence of tuples containing them.

Returns

A sequence of ValueTuple`2 containing corresponding elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
Generic Types
Name Description
TFirst The type of the elements of first.
TSecond The type of the elements of second.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
System.InvalidOperationException Any of the input sequences are shorter than the others.
Remarks

This method uses deferred execution and stream its results.

EquiZip``3(resultSelector,first,second) method

Summary

Applies a specified function to the corresponding elements of second sequences, producing a sequence of the results.

The resulting sequence has the same length as the input sequences. If the input sequences are of different lengths, an exception is thrown.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Func{``0,``1,``2} The second sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
TFirst The type of the elements of first.
TSecond The type of the elements of second.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
System.InvalidOperationException Any of the input sequences are shorter than the others.
Remarks

This method uses deferred execution and stream its results.

EquiZip``3(first,second,third) method

Summary

Joins the corresponding elements of third sequences, producing a sequence of tuples containing them.

Returns

A sequence of ValueTuple`3 containing corresponding elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
Generic Types
Name Description
TFirst The type of the elements of first.
TSecond The type of the elements of second.
TThird The type of the elements of third.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
System.InvalidOperationException Any of the input sequences are shorter than the others.
Remarks

This method uses deferred execution and stream its results.

EquiZip``4(resultSelector,first,second,third) method

Summary

Applies a specified function to the corresponding elements of third sequences, producing a sequence of the results.

The resulting sequence has the same length as the input sequences. If the input sequences are of different lengths, an exception is thrown.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Func{``0,``1,``2,``3} The third sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
TFirst The type of the elements of first.
TSecond The type of the elements of second.
TThird The type of the elements of third.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
System.InvalidOperationException Any of the input sequences are shorter than the others.
Remarks

This method uses deferred execution and stream its results.

EquiZip``4(first,second,third,fourth) method

Summary

Joins the corresponding elements of fourth sequences, producing a sequence of tuples containing them.

Returns

A sequence of ValueTuple`4 containing corresponding elements from each of the sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``1} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``2} The third sequence of elements.
fourth System.Collections.Generic.IEnumerable{``3} The fourth sequence of elements.
Generic Types
Name Description
TFirst The type of the elements of first.
TSecond The type of the elements of second.
TThird The type of the elements of third.
TFourth The type of the elements of fourth.
Exceptions
Name Description
System.ArgumentNullException Any of the input sequences is null.
System.InvalidOperationException Any of the input sequences are shorter than the others.
Remarks

This method uses deferred execution and stream its results.

EquiZip``5(resultSelector,first,second,third,fourth) method

Summary

Applies a specified function to the corresponding elements of fourth sequences, producing a sequence of the results.

The resulting sequence has the same length as the input sequences. If the input sequences are of different lengths, an exception is thrown.

Returns

A sequence of elements returned by resultSelector.

Parameters
Name Type Description
resultSelector System.Collections.Generic.IEnumerable{``0} A projection function that combines
elements from all of the sequences.
first System.Collections.Generic.IEnumerable{``1} The first sequence of elements.
second System.Collections.Generic.IEnumerable{``2} The second sequence of elements.
third System.Collections.Generic.IEnumerable{``3} The third sequence of elements.
fourth System.Func{``0,``1,``2,``3,``4} The fourth sequence of elements.
Generic Types
Name Description
TResult The type of the elements of the result sequence.
TFirst The type of the elements of first.
TSecond The type of the elements of second.
TThird The type of the elements of third.
TFourth The type of the elements of fourth.
Exceptions
Name Description
System.ArgumentNullException resultSelector or any of the input sequences is null.
System.InvalidOperationException Any of the input sequences are shorter than the others.
Remarks

This method uses deferred execution and stream its results.

Evaluate``1(functions) method

Summary

Returns a sequence containing the values resulting from invoking (in order) each function in the source sequence of functions.

Returns

A sequence with results from invoking functions.

Parameters
Name Type Description
functions System.Collections.Generic.IEnumerable{System.Func{``0}} The functions to evaluate.
Generic Types
Name Description
T The type of the object returned by the functions.
Exceptions
Name Description
System.ArgumentNullException When functions is null.
Remarks

This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the functions will be evaluated multiple times too.

Exactly``1(source,count) method

Summary

Determines whether or not the number of elements in the sequence is equals to the given integer.

Returns

true if the number of elements in the sequence is equals to the given integer or false otherwise.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence
count System.Int32 The exactly number of items a sequence must have for this
function to return true
Generic Types
Name Description
T Element type of sequence
Exceptions
Name Description
System.ArgumentNullException source is null
System.ArgumentOutOfRangeException count is negative
Example
<![CDATA[
            var numbers = new[] { 123, 456, 789 };
            var result = numbers.Exactly(3);
            ]]>

The result variable will contain true.

ExceptBy``2(first,second,keySelector) method

Summary

Returns the set of elements in the first sequence which aren't in the second sequence, according to a given key selector.

Returns

A sequence of elements from first whose key was not also a key for any element in second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The sequence of potentially included elements.
second System.Collections.Generic.IEnumerable{``0} The sequence of elements whose keys may prevent elements in
first from being returned.
keySelector System.Func{``0,``1} The mapping from source element to key.
Generic Types
Name Description
TSource The type of the elements in the input sequences.
TKey The type of the key returned by keySelector.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
System.ArgumentNullException keySelector is null.
Remarks

This is a set operation; if multiple elements in first have equal keys, only the first such element is returned. This operator uses deferred execution and streams the results, although a set of keys from second is immediately selected and retained.

ExceptBy``2(first,second,keySelector,keyComparer) method

Summary

Returns the set of elements in the first sequence which aren't in the second sequence, according to a given key selector.

Returns

A sequence of elements from first whose key was not also a key for any element in second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The sequence of potentially included elements.
second System.Collections.Generic.IEnumerable{``0} The sequence of elements whose keys may prevent elements in
first from being returned.
keySelector System.Func{``0,``1} The mapping from source element to key.
keyComparer System.Collections.Generic.IEqualityComparer{``1} The equality comparer to use to determine whether or not keys are equal.
If null, the default equality comparer for TSource is used.
Generic Types
Name Description
TSource The type of the elements in the input sequences.
TKey The type of the key returned by keySelector.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
System.ArgumentNullException keySelector is null.
System.ArgumentNullException keyComparer is null.
Remarks

This is a set operation; if multiple elements in first have equal keys, only the first such element is returned. This operator uses deferred execution and streams the results, although a set of keys from second is immediately selected and retained.

Exclude``1(sequence,startIndex,count) method

Summary

Excludes a contiguous number of elements from a sequence starting at a given index.

Returns

A sequence that excludes the specified portion of elements

Parameters
Name Type Description
sequence System.Collections.Generic.IEnumerable{``0} The sequence to exclude elements from
startIndex System.Int32 The zero-based index at which to begin excluding elements
count System.Int32 The number of elements to exclude
Generic Types
Name Description
T The type of the elements of the sequence
Exceptions
Name Description
System.ArgumentNullException sequence is null.
System.ArgumentOutOfRangeException startIndex or count is less than 0.

FallbackIfEmpty``1(source,fallback) method

Summary

Returns the elements of a sequence, but if it is empty then returns an alternate sequence from an array of values.

Returns

An IEnumerable`1 that containing fallback values if source is empty; otherwise, source.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
fallback ``0[] The array that is returned as the alternate
sequence if source is empty.
Generic Types
Name Description
T The type of the elements in the sequences.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException fallback is null.

FallbackIfEmpty``1(source,fallback) method

Summary

Returns the elements of a sequence, but if it is empty then returns an alternate sequence of values.

Returns

An IEnumerable`1 that containing fallback values if source is empty; otherwise, source.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
fallback System.Collections.Generic.IEnumerable{``0} The alternate sequence that is returned
if source is empty.
Generic Types
Name Description
T The type of the elements in the sequences.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException fallback is null.

FillBackward``1(source) method

Summary

Returns a sequence with each null reference or value in the source replaced with the following non-null reference or value in that sequence.

Returns

An IEnumerable`1 with null references or values replaced.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
Generic Types
Name Description
T Type of the elements in the source sequence.
Remarks

This method uses deferred execution semantics and streams its results. If references or values are null at the end of the sequence then they remain null.

FillBackward``1(source,predicate) method

Summary

Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. An additional parameter specifies a function used to determine if an element is considered missing or not.

Returns

An IEnumerable`1 with missing values replaced.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The function used to determine if
an element in the sequence is considered missing.
Generic Types
Name Description
T Type of the elements in the source sequence.
Remarks

This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.

FillBackward``1(source,predicate,fillSelector) method

Summary

Returns a sequence with each missing element in the source replaced with the following non-missing element in that sequence. Additional parameters specify two functions, one used to determine if an element is considered missing or not and another to provide the replacement for the missing element.

Returns

An IEnumerable`1 with missing elements filled.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The function used to determine if
an element in the sequence is considered missing.
fillSelector System.Func{``0,``0,``0} The function used to produce the element
that will replace the missing one. Its first argument receives the
current element considered missing while the second argument
receives the next non-missing element.
Generic Types
Name Description
T Type of the elements in the source sequence.
Remarks

This method uses deferred execution semantics and streams its results. If elements are missing at the end of the sequence then they remain missing.

FillForward``1(source) method

Summary

Returns a sequence with each null reference or value in the source replaced with the previous non-null reference or value seen in that sequence.

Returns

An IEnumerable`1 with null references or values replaced.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
Generic Types
Name Description
T Type of the elements in the source sequence.
Remarks

This method uses deferred execution semantics and streams its results. If references or values are null at the start of the sequence then they remain null.

FillForward``1(source,predicate) method

Summary

Returns a sequence with each missing element in the source replaced with the previous non-missing element seen in that sequence. An additional parameter specifies a function used to determine if an element is considered missing or not.

Returns

An IEnumerable`1 with missing values replaced.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The function used to determine if
an element in the sequence is considered missing.
Generic Types
Name Description
T Type of the elements in the source sequence.
Remarks

This method uses deferred execution semantics and streams its results. If elements are missing at the start of the sequence then they remain missing.

FillForward``1(source,predicate,fillSelector) method

Summary

Returns a sequence with each missing element in the source replaced with one based on the previous non-missing element seen in that sequence. Additional parameters specify two functions, one used to determine if an element is considered missing or not and another to provide the replacement for the missing element.

Returns

An IEnumerable`1 with missing values replaced.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The function used to determine if
an element in the sequence is considered missing.
fillSelector System.Func{``0,``0,``0} The function used to produce the element
that will replace the missing one. Its first argument receives the
current element considered missing while the second argument
receives the previous non-missing element.
Generic Types
Name Description
T Type of the elements in the source sequence.
Remarks

This method uses deferred execution semantics and streams its results. If elements are missing at the start of the sequence then they remain missing.

FindIndex``1(source,predicate) method

Summary

Searches for an element that matches the conditions defined by the specified predicate and returns the zero-based index of the first occurrence within the entire IEnumerable`1.

Returns

The zero-based index of the first occurrence of an element that matches the conditions defined by predicate within the entire IEnumerable`1, if found; otherwise, -1.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source or predicate is
null.
Remarks

The IEnumerable`1 is searched forward starting at the first element and ending at the last element.

The predicate is a delegate to a method that returns true if the object passed to it matches the conditions defined in the delegate. The elements of the current IEnumerable`1 are individually passed to the predicate delegate.

This operator executes immediately.

FindIndex``1(source,predicate,index) method

Summary

Searches for an element that matches the conditions defined by the specified predicate and returns the zero-based index of the first occurrence within the range of elements in the IEnumerable`1 that extends from the specified index to the last element.

Returns

The zero-based index of the first occurrence of an element that matches the conditions defined by predicate within the the range of elements in the IEnumerable`1 that extends from index to the last element, if found; otherwise, -1.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
index System.Index The Index of the starting element within the sequence.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source or predicate is
null.
Remarks

The IEnumerable`1 is searched forward starting at index and ending at the last element.

The predicate is a delegate to a method that returns true if the object passed to it matches the conditions defined in the delegate. The elements of the current IEnumerable`1 are individually passed to the predicate delegate.

This operator executes immediately.

FindIndex``1(source,predicate,index,count) method

Summary

Searches for an element that matches the conditions defined by the specified predicate and returns the zero-based index of the first occurrence within the range of elements in the IEnumerable`1 that starts at the specified index to the last element and contains the specified number of elements.

Returns

The zero-based index of the first occurrence of an element that matches the conditions defined by predicate within the the range of elements in the IEnumerable`1 that that starts at index and contains count number of elements, if found; otherwise, -1.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
index System.Index The Index of the starting element within the sequence.
count System.Int32 The number of elements in the section to search.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source or predicate is
null.
System.ArgumentOutOfRangeException count is less than 0.
Remarks

The IEnumerable`1 is searched forward starting at index and ending at index plus count minus 1, if count is greater than 0.

The predicate is a delegate to a method that returns true if the object passed to it matches the conditions defined in the delegate. The elements of the current IEnumerable`1 are individually passed to the predicate delegate.

This operator executes immediately.

FindLastIndex``1(source,predicate) method

Summary

Searches for an element that matches the conditions defined by the specified predicate and returns the zero-based index of the last occurrence within the entire IEnumerable`1.

Returns

The zero-based index of the last occurrence of an element that matches the conditions defined by predicate within the entire IEnumerable`1, if found; otherwise, -1.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source or predicate is
null.
Remarks

The IEnumerable`1 is searched forward starting at the first element and ending at the last element, and the index of the last instance of an element that matches the conditions defined by predicate is returned.

The predicate is a delegate to a method that returns true if the object passed to it matches the conditions defined in the delegate. The elements of the current IEnumerable`1 are individually passed to the predicate delegate.

This operator executes immediately.

FindLastIndex``1(source,predicate,index) method

Summary

Searches for an element that matches the conditions defined by the specified predicate and returns the zero-based index of the last occurrence within the range of elements in the IEnumerable`1 that extends backwards from the specified index to the first element.

Returns

The zero-based index of the last occurrence of an element that matches the conditions defined by predicate within the the range of elements in the IEnumerable`1 that extends backwards from index to the first element, if found; otherwise, -1.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
index System.Index The Index of the ending element within the sequence.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source or predicate is
null.
Remarks

The IEnumerable`1 is searched forward starting at the first element and ending at index, and the index of the last instance of an element that matches the conditions defined by predicate is returned.

The predicate is a delegate to a method that returns true if the object passed to it matches the conditions defined in the delegate. The elements of the current IEnumerable`1 are individually passed to the predicate delegate.

This operator executes immediately.

FindLastIndex``1(source,predicate,index,count) method

Summary

Searches for an element that matches the conditions defined by the specified predicate and returns the zero-based index of the last occurrence within the range of elements in the IEnumerable`1 that ends at the specified index to the last element and contains the specified number of elements.

Returns

The zero-based index of the last occurrence of an element that matches the conditions defined by predicate within the the range of elements in the IEnumerable`1 that that ends at index and contains count number of elements, if found; otherwise, -1.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The source sequence.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
index System.Index The Index of the ending element within the sequence.
count System.Int32 The number of elements in the section to search.
Generic Types
Name Description
TSource The type of elements of source
Exceptions
Name Description
System.ArgumentNullException source or predicate is
null.
System.ArgumentOutOfRangeException count is less than 0.
Remarks

The IEnumerable`1 is searched forward starting at the first element and ending at index, and the index of the last instance of an element that matches the conditions defined by predicate no earlier in the sequence than count items before index is returned.

The predicate is a delegate to a method that returns true if the object passed to it matches the conditions defined in the delegate. The elements of the current IEnumerable`1 are individually passed to the predicate delegate.

This operator executes immediately.

Flatten(source) method

Summary

Flattens a sequence containing arbitrarily-nested sequences.

Returns

A sequence that contains the elements of source and all nested sequences (except strings).

Parameters
Name Type Description
source System.Collections.IEnumerable The sequence that will be flattened.
Exceptions
Name Description
System.ArgumentNullException source is null.

Flatten(source,predicate) method

Summary

Flattens a sequence containing arbitrarily-nested sequences. An additional parameter specifies a predicate function used to determine whether a nested IEnumerable should be flattened or not.

Returns

A sequence that contains the elements of source and all nested sequences for which the predicate function returned true.

Parameters
Name Type Description
source System.Collections.IEnumerable The sequence that will be flattened.
predicate System.Func{System.Collections.IEnumerable,System.Boolean} A function that receives each element that implements
IEnumerable and indicates if its elements should be
recursively flattened into the resulting sequence.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException predicate is null.

Flatten(source,selector) method

Summary

Flattens a sequence containing arbitrarily-nested sequences. An additional parameter specifies a function that projects an inner sequence via a property of an object.

Returns

A sequence that contains the elements of source and all nested sequences projected via the selector function.

Parameters
Name Type Description
source System.Collections.IEnumerable The sequence that will be flattened.
selector System.Func{System.Object,System.Collections.IEnumerable} A function that receives each element of the sequence as an object
and projects an inner sequence to be flattened. If the function
returns null then the object argument is considered a leaf
of the flattening process.
Exceptions
Name Description
System.ArgumentNullException source is null.
System.ArgumentNullException selector is null.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 1 element.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 1 element.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 2 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 2 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 3 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 3 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 4 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 4 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 5 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 5 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 6 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 6 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 7 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 7 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 8 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 8 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 9 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 9 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 10 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 10 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 11 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 11 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 12 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 12 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 13 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 13 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 14 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 14 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 15 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 15 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

Fold``2(source,folder) method

Summary

Returns the result of applying a function to a sequence of 16 elements.

Returns

The folded value returned by folder.

Parameters
Name Type Description
source System.Collections.Generic.IEnumerable{``0} The sequence of items to fold.
folder System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1} Function to apply to the elements in the sequence.
Generic Types
Name Description
T Type of element in the source sequence
TResult Type of the result
Exceptions
Name Description
System.ArgumentNullException source or folder is null.
System.InvalidOperationException source does not contain exactly 16 elements.
Remarks

This operator uses immediate execution and buffers as many items of the source sequence as necessary.

From``1(function) method

Summary

Returns a single-element sequence containing the result of invoking the function.

Returns

A sequence with the value resulting from invoking function.

Parameters
Name Type Description
function System.Func{``0} The function to evaluate.
Generic Types
Name Description
T The type of the object returned by the function.
Remarks

This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the function will be invoked multiple times too.

From``1(function1,function2) method

Summary

Returns a sequence containing the result of invoking each parameter function in order.

Returns

A sequence with the values resulting from invoking function1 and function2.

Parameters
Name Type Description
function1 System.Func{``0} The first function to evaluate.
function2 System.Func{``0} The second function to evaluate.
Generic Types
Name Description
T The type of the object returned by the functions.
Remarks

This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the functions will be invoked multiple times too.

From``1(function1,function2,function3) method

Summary

Returns a sequence containing the result of invoking each parameter function in order.

Returns

A sequence with the values resulting from invoking function1, function2 and function3.

Parameters
Name Type Description
function1 System.Func{``0} The first function to evaluate.
function2 System.Func{``0} The second function to evaluate.
function3 System.Func{``0} The third function to evaluate.
Generic Types
Name Description
T The type of the object returned by the functions.
Remarks

This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the functions will be invoked multiple times too.

From``1(functions) method

Summary

Returns a sequence containing the values resulting from invoking (in order) each function in the source sequence of functions.

Returns

A sequence with the values resulting from invoking all of the functions.

Parameters
Name Type Description
functions System.Func{``0}[] The functions to evaluate.
Generic Types
Name Description
T The type of the object returned by the functions.
Exceptions
Name Description
System.ArgumentNullException When functions is null.
Remarks

This operator uses deferred execution and streams the results. If the resulting sequence is enumerated multiple times, the functions will be invoked multiple times too.

FullGroupJoin``3(first,second,firstKeySelector,secondKeySelector) method

Summary

Performs a Full Group Join between the first and second sequences.

Returns

A sequence of elements joined from first and second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} First sequence
second System.Collections.Generic.IEnumerable{``1} Second sequence
firstKeySelector System.Func{``0,``2} The mapping from first sequence to key
secondKeySelector System.Func{``1,``2} The mapping from second sequence to key
Generic Types
Name Description
TFirst The type of the elements in the first input sequence
TSecond The type of the elements in the second input sequence
TKey The type of the key to use to join
Remarks

This operator uses deferred execution and streams the results. The results are yielded in the order of the elements found in the first sequence followed by those found only in the second. In addition, the callback responsible for projecting the results is supplied with sequences which preserve their source order.

FullGroupJoin``3(first,second,firstKeySelector,secondKeySelector,comparer) method

Summary

Performs a Full Group Join between the first and second sequences.

Returns

A sequence of elements joined from first and second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} First sequence
second System.Collections.Generic.IEnumerable{``1} Second sequence
firstKeySelector System.Func{``0,``2} The mapping from first sequence to key
secondKeySelector System.Func{``1,``2} The mapping from second sequence to key
comparer System.Collections.Generic.IEqualityComparer{``2} The equality comparer to use to determine whether or not keys are equal.
If null, the default equality comparer for TKey is used.
Generic Types
Name Description
TFirst The type of the elements in the first input sequence
TSecond The type of the elements in the second input sequence
TKey The type of the key to use to join
Remarks

This operator uses deferred execution and streams the results. The results are yielded in the order of the elements found in the first sequence followed by those found only in the second. In addition, the callback responsible for projecting the results is supplied with sequences which preserve their source order.

FullGroupJoin``4(first,second,firstKeySelector,secondKeySelector,resultSelector) method

Summary

Performs a full group-join between two sequences.

Returns

A sequence of elements joined from first and second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} First sequence
second System.Collections.Generic.IEnumerable{``1} Second sequence
firstKeySelector System.Func{``0,``2} The mapping from first sequence to key
secondKeySelector System.Func{``1,``2} The mapping from second sequence to key
resultSelector System.Func{``2,System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1},``3} Function to apply to each pair of elements plus the key
Generic Types
Name Description
TFirst The type of the elements in the first input sequence
TSecond The type of the elements in the second input sequence
TKey The type of the key to use to join
TResult The type of the elements of the resulting sequence
Remarks

This operator uses deferred execution and streams the results. The results are yielded in the order of the elements found in the first sequence followed by those found only in the second. In addition, the callback responsible for projecting the results is supplied with sequences which preserve their source order.

FullGroupJoin``4(first,second,firstKeySelector,secondKeySelector,resultSelector,comparer) method

Summary

Performs a full group-join between two sequences.

Returns

A sequence of elements joined from first and second.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} First sequence
second System.Collections.Generic.IEnumerable{``1} Second sequence
firstKeySelector System.Func{``0,``2} The mapping from first sequence to key
secondKeySelector System.Func{``1,``2} The mapping from second sequence to key
resultSelector System.Func{``2,System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``1},``3} Function to apply to each pair of elements plus the key
comparer System.Collections.Generic.IEqualityComparer{``2} The equality comparer to use to determine whether or not keys are equal.
If null, the default equality comparer for TKey is used.
Generic Types
Name Description
TFirst The type of the elements in the first input sequence
TSecond The type of the elements in the second input sequence
TKey The type of the key to use to join
TResult The type of the elements of the resulting sequence
Remarks

This operator uses deferred execution and streams the results. The results are yielded in the order of the elements found in the first sequence followed by those found only in the second. In addition, the callback responsible for projecting the results is supplied with sequences which preserve their source order.

FullJoin``3(first,second,keySelector,firstSelector,secondSelector,bothSelector) method

Summary

Performs a full outer join on two homogeneous sequences. Additional arguments specify key selection functions and result projection functions.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence.
second System.Collections.Generic.IEnumerable{``0} The second sequence.
keySelector System.Func{``0,``1} Function that projects the key given an element of one of the sequences to join.
firstSelector System.Func{``0,``2} Function that projects the result given just an element from
first where there is no corresponding element
in second.
secondSelector System.Func{``0,``2} Function that projects the result given just an element from
second where there is no corresponding element
in first.
bothSelector System.Func{``0,``0,``2} Function that projects the result given an element from
first and an element from second
that match on a common key.
Generic Types
Name Description
TSource The type of elements in the source sequence.
TKey The type of the key returned by the key selector function.
TResult The type of the result elements.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
System.ArgumentNullException keySelector is null.
System.ArgumentNullException firstSelector is null.
System.ArgumentNullException secondSelector is null.
System.ArgumentNullException bothSelector is null.
Remarks

This method uses deferred execution and streams its results.

FullJoin``3(first,second,keySelector,firstSelector,secondSelector,bothSelector,comparer) method

Summary

Performs a full outer join on two homogeneous sequences. Additional arguments specify key selection functions, result projection functions and a key comparer.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence.
second System.Collections.Generic.IEnumerable{``0} The second sequence.
keySelector System.Func{``0,``1} Function that projects the key given an element of one of the sequences to join.
firstSelector System.Func{``0,``2} Function that projects the result given just an element from
first where there is no corresponding element
in second.
secondSelector System.Func{``0,``2} Function that projects the result given just an element from
second where there is no corresponding element
in first.
bothSelector System.Func{``0,``0,``2} Function that projects the result given an element from
first and an element from second
that match on a common key.
comparer System.Collections.Generic.IEqualityComparer{``1} The IEqualityComparer`1 instance used to compare
keys for equality.
Generic Types
Name Description
TSource The type of elements in the source sequence.
TKey The type of the key returned by the key selector function.
TResult The type of the result elements.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
System.ArgumentNullException keySelector is null.
System.ArgumentNullException firstSelector is null.
System.ArgumentNullException secondSelector is null.
System.ArgumentNullException bothSelector is null.
Remarks

This method uses deferred execution and streams its results.

FullJoin``4(first,second,firstKeySelector,secondKeySelector,firstSelector,secondSelector,bothSelector) method

Summary

Performs a full outer join on two heterogeneous sequences. Additional arguments specify key selection functions and result projection functions.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence.
second System.Collections.Generic.IEnumerable{``1} The second sequence.
firstKeySelector System.Func{``0,``2} Function that projects the key given an element from first.
secondKeySelector System.Func{``1,``2} Function that projects the key given an element from second.
firstSelector System.Func{``0,``3} Function that projects the result given just an element from
first where there is no corresponding element
in second.
secondSelector System.Func{``1,``3} Function that projects the result given just an element from
second where there is no corresponding element
in first.
bothSelector System.Func{``0,``1,``3} Function that projects the result given an element from
first and an element from second
that match on a common key.
Generic Types
Name Description
TFirst The type of elements in the first sequence.
TSecond The type of elements in the second sequence.
TKey The type of the key returned by the key selector functions.
TResult The type of the result elements.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
System.ArgumentNullException firstKeySelector is null.
System.ArgumentNullException secondKeySelector is null.
System.ArgumentNullException firstSelector is null.
System.ArgumentNullException secondSelector is null.
System.ArgumentNullException bothSelector is null.
Remarks

This method uses deferred execution and streams its results.

FullJoin``4(first,second,firstKeySelector,secondKeySelector,firstSelector,secondSelector,bothSelector,comparer) method

Summary

Performs a full outer join on two heterogeneous sequences. Additional arguments specify key selection functions, result projection functions and a key comparer.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
first System.Collections.Generic.IEnumerable{``0} The first sequence.
second System.Collections.Generic.IEnumerable{``1} The second sequence.
firstKeySelector System.Func{``0,``2} Function that projects the key given an element from first.
secondKeySelector System.Func{``1,``2} Function that projects the key given an element from second.
firstSelector System.Func{``0,``3} Function that projects the result given just an element from
first where there is no corresponding element
in second.
secondSelector System.Func{``1,``3} Function that projects the result given just an element from
second where there is no corresponding element
in first.
bothSelector System.Func{``0,``1,``3} Function that projects the result given an element from
first and an element from second
that match on a common key.
comparer System.Collections.Generic.IEqualityComparer{``2} The IEqualityComparer`1 instance used to compare
keys for equality.
Generic Types
Name Description
TFirst The type of elements in the first sequence.
TSecond The type of elements in the second sequence.
TKey The type of the key returned by the key selector functions.
TResult The type of the result elements.
Exceptions
Name Description
System.ArgumentNullException first is null.
System.ArgumentNullException second is null.
System.ArgumentNullException firstKeySelector is null.
System.ArgumentNullException secondKeySelector is null.
System.ArgumentNullException firstSelector is null.
System.ArgumentNullException secondSelector is null.
System.ArgumentNullException bothSelector is null.
Remarks

This method uses deferred execution and streams its results.

FullOuterJoin``3(left,right,joinType,leftKeySelector,rightKeySelector) method

Summary

Performs a full outer join on two heterogeneous sequences, returning a ValueTuple`2 containing the elements from left and right, if present, and null otherwise. Additional arguments specify key selection functions.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
left System.Collections.Generic.IEnumerable{``0} The first sequence.
right System.Collections.Generic.IEnumerable{``1} The second sequence.
joinType SuperLinq.JoinType A value indicating which type of join to use.
leftKeySelector System.Func{``0,``2} Function that projects the key given an element from left.
rightKeySelector System.Func{``1,``2} Function that projects the key given an element from right.
Generic Types
Name Description
TLeft The type of elements in the first sequence.
TRight The type of elements in the second sequence.
TKey The type of the key returned by the key selector functions.
Exceptions
Name Description
System.ArgumentNullException left is null.
System.ArgumentNullException right is null.
System.ArgumentNullException leftKeySelector is null.
System.ArgumentNullException rightKeySelector is null.
System.ArgumentException joinType is Loop.
Remarks

This method uses deferred execution and streams its results.

FullOuterJoin``4(left,right,joinType,leftKeySelector,rightKeySelector,comparer) method

Summary

Performs a full outer join on two heterogeneous sequences, returning a ValueTuple`2 containing the elements from left and right, if present, and null otherwise. Additional arguments specify key selection functions and a key comparer.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
left System.Collections.Generic.IEnumerable{``0} The first sequence.
right System.Collections.Generic.IEnumerable{``1} The second sequence.
joinType SuperLinq.JoinType A value indicating which type of join to use.
leftKeySelector System.Func{``0,``2} Function that projects the key given an element from left.
rightKeySelector System.Func{``1,``2} Function that projects the key given an element from right.
comparer ``3 The comparer implementing types IEqualityComparer`1 and
IComparer`1 used to compare keys.
Generic Types
Name Description
TLeft The type of elements in the first sequence.
TRight The type of elements in the second sequence.
TKey The type of the key returned by the key selector functions.
TComparer The type of the comparer used to compare keys.
Exceptions
Name Description
System.ArgumentNullException left is null.
System.ArgumentNullException right is null.
System.ArgumentNullException leftKeySelector is null.
System.ArgumentNullException rightKeySelector is null.
System.ArgumentException joinType is Loop.
Remarks

This method uses deferred execution and streams its results.

FullOuterJoin``4(left,right,joinType,leftKeySelector,rightKeySelector,leftResultSelector,rightResultSelector,bothResultSelector) method

Summary

Performs a full outer join on two heterogeneous sequences using the default comparer for TKey. Additional arguments specify key selection and result projection functions.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
left System.Collections.Generic.IEnumerable{``0} The first sequence.
right System.Collections.Generic.IEnumerable{``1} The second sequence.
joinType SuperLinq.JoinType A value indicating which type of join to use.
leftKeySelector System.Func{``0,``2} Function that projects the key given an element from left.
rightKeySelector System.Func{``1,``2} Function that projects the key given an element from right.
leftResultSelector System.Func{``0,``3} Function that projects the result given just an element from
left where there is no corresponding element
in right.
rightResultSelector System.Func{``1,``3} Function that projects the result given just an element from
right where there is no corresponding element
in left.
bothResultSelector System.Func{``0,``1,``3} Function that projects the result given an element from
left and an element from right
that match on a common key.
Generic Types
Name Description
TLeft The type of elements in the first sequence.
TRight The type of elements in the second sequence.
TKey The type of the key returned by the key selector functions.
TResult The type of the result elements.
Exceptions
Name Description
System.ArgumentNullException left is null.
System.ArgumentNullException right is null.
System.ArgumentNullException leftKeySelector is null.
System.ArgumentNullException rightKeySelector is null.
System.ArgumentNullException leftResultSelector is null.
System.ArgumentNullException rightResultSelector is null.
System.ArgumentNullException bothResultSelector is null.
System.ArgumentException joinType is Loop.
Remarks

This method uses deferred execution and streams its results.

FullOuterJoin``5(left,right,joinType,leftKeySelector,rightKeySelector,leftResultSelector,rightResultSelector,bothResultSelector,comparer) method

Summary

Performs a full outer join on two heterogeneous sequences. Additional arguments specify key selection functions, result projection functions and a key comparer.

Returns

A sequence containing results projected from a full outer join of the two input sequences.

Parameters
Name Type Description
left System.Collections.Generic.IEnumerable{``0} The first sequence.
right System.Collections.Generic.IEnumerable{``1} The second sequence.
joinType SuperLinq.JoinType A value indicating which type of join to use.
leftKeySelector System.Func{``0,``2} Function that projects the key given an element from left.
rightKeySelector System.Func{``1,``2} Function that projects the key given an element from right.
leftResultSelector System.Func{``0,``4} Function that projects the result given just an element from
left where there is no corresponding element
in right.
rightResultSelector System.Func{``1,``4} Function that projects the result given just an element from
right where there is no corresponding element
in left.
bothResultSelector System.Func{``0,``1,``4} Function that projects the result given an element from
left and an element from right
that match on a common key.
comparer ``3 The comparer implementing types IEqualityComparer`1 and
IComparer`1 used to compare keys.
Generic Types
Name Description
TLeft The type of elements in the first sequence.
TRight The type of elements in the second sequence.
TKey The type of the key returned by the key selector functions.
TComparer The type of the comparer used to compare keys.
TResult The type of the result elements.
Exceptions
Name Description
System.ArgumentNullException left is null.
System.ArgumentNullException right is null.
System.ArgumentNullException leftKeySelector is null.
System.ArgumentNullException rightKeySelector is null.
System.ArgumentNullException leftResultSelector is null.
System.ArgumentNullException rightResultSelector is null.
System.ArgumentNullException bothResultSelector is null.
System.ArgumentException joinType is Loop.
Remarks

This method uses deferred execution and streams its results.

GenerateByIndex``1(generator) method

Summary

Returns a sequence of values based on indexes.

Returns

A sequence of generated results.

Parameters
Name Type Description
generator System.Func{System.Int32,``0} Generation function to apply to each index.
Generic Types
Name Description
TResult The type of the value returned by generator
and therefore the elements of the generated sequence.
Exceptions
Name Description
System.ArgumentNullException generator is null.
Remarks

The sequence is (practically) infinite where the index ranges from zero to MaxValue inclusive.

This function defers execution and streams the results.

Generate``1(initial,generator) method

Summary

Returns a sequence of values consecutively generated by a generator function.

Returns

A sequence containing the generated values.

Parameters
Name Type Description
initial ``0 Value of first element in sequence
generator System.Func{``0,``0} Generator function which takes the previous series element and uses it to generate the next element.
Generic Types
Name Description
TResult Type of elements to generate.
Exceptions
Name Description
System.ArgumentNullException generator is null.
Example
<![CDATA[
            var result = SuperEnumerable.Generate(2, n => n * n).Take(5);
            ]]>

The result variable, when iterated over, will yield 2, 4, 16, 256, and 65536, in turn.

Remarks

This function defers element generation until needed and streams the results.

GetShortestPathCost``2(start,getNeighbors,end) method

Summary

Calculate the cost of the shortest path from state start to state end, using Dijkstra's algorithm.

Returns

The traversal cost of the shortest path from start to end.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1}}} A function that returns the neighbors for a given state
and the total cost to get to that state based on the
traversal cost at the current state.
end ``0 The target state
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Exceptions
Name Description
System.ArgumentNullException getNeighbors is null.
System.InvalidOperationException The map is entirely explored and no path to end is found.
Remarks

This method uses Dijkstra's algorithm to explore a map and find the shortest path from start to end. An UpdatablePriorityQueue`2 is used to manage the list of TStates to process, to reduce the computation cost of this operator.

Loops and cycles are automatically detected and handled correctly by this operator; only the cheapest path to a given TState is used, and other paths (including loops) are discarded.

Dijkstra's algorithm assumes that all costs are positive, that is to say, that it is not possible to go a negative distance from one state to the next. Violating this assumption will have undefined behavior.

This method will operate on an infinite map, however, performance will depend on how many states are required to be evaluated before reaching the target point.

This method uses Default to compare TStates and Default to compare traversal TCosts.

This operator executes immediately.

GetShortestPathCost``2(start,getNeighbors,end,stateComparer,costComparer) method

Summary

Calculate the cost of the shortest path from state start to state end, using Dijkstra's algorithm.

Returns

The traversal cost of the shortest path from start to end.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1}}} A function that returns the neighbors for a given state
and the total cost to get to that state based on the
traversal cost at the current state.
end ``0 The target state
stateComparer System.Collections.Generic.IEqualityComparer{``0} A custom equality comparer for TState
costComparer System.Collections.Generic.IComparer{``1} A custom comparer for TCost
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Exceptions
Name Description
System.ArgumentNullException getNeighbors is null.
System.InvalidOperationException The map is entirely explored and no path to end is found.
Remarks

This method uses Dijkstra's algorithm to explore a map and find the shortest path from start to end. An UpdatablePriorityQueue`2 is used to manage the list of TStates to process, to reduce the computation cost of this operator.

Loops and cycles are automatically detected and handled correctly by this operator; only the cheapest path to a given TState is used, and other paths (including loops) are discarded.

Dijkstra's algorithm assumes that all costs are positive, that is to say, that it is not possible to go a negative distance from one state to the next. Violating this assumption will have undefined behavior.

This method will operate on an infinite map, however, performance will depend on how many states are required to be evaluated before reaching the target point.

This operator executes immediately.

GetShortestPathCost``2(start,getNeighbors,predicate) method

Summary

Calculate the cost of the shortest path from state start to a state that satisfies the conditions expressed by predicate, using Dijkstra's algorithm.

Returns

The traversal cost of the shortest path from start to a state that satisfies the conditions expressed by predicate.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1}}} A function that returns the neighbors for a given state and the total cost to get to that state based on the
traversal cost at the current state.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Exceptions
Name Description
System.ArgumentNullException getNeighbors is null.
System.InvalidOperationException The map is entirely explored and no state that satisfies the
conditions expressed by predicate is found.
Remarks

This method uses Dijkstra's algorithm to explore a map and find the shortest path from start to a state that satisfies the conditions expressed by predicate. An UpdatablePriorityQueue`2 is used to manage the list of TStates to process, to reduce the computation cost of this operator.

Loops and cycles are automatically detected and handled correctly by this operator; only the cheapest path to a given TState is used, and other paths (including loops) are discarded.

Dijkstra's algorithm assumes that all costs are positive, that is to say, that it is not possible to go a negative distance from one state to the next. Violating this assumption will have undefined behavior.

This method will operate on an infinite map, however, performance will depend on how many states are required to be evaluated before reaching the target point.

This method uses Default to compare TStates and Default to compare traversal TCosts.

This operator executes immediately.

GetShortestPathCost``2(start,getNeighbors,predicate,stateComparer,costComparer) method

Summary

Calculate the cost of the shortest path from state start to a state that satisfies the conditions expressed by predicate, using Dijkstra's algorithm.

Returns

The traversal cost of the shortest path from start to a state that satisfies the conditions expressed by predicate.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1}}} A function that returns the neighbors for a given state and the total cost to get to that state based on the
traversal cost at the current state.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
stateComparer System.Collections.Generic.IEqualityComparer{``0} A custom equality comparer for TState
costComparer System.Collections.Generic.IComparer{``1} A custom comparer for TCost
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Exceptions
Name Description
System.ArgumentNullException getNeighbors is null.
System.InvalidOperationException The map is entirely explored and no state that satisfies the
conditions expressed by predicate is found.
Remarks

This method uses Dijkstra's algorithm to explore a map and find the shortest path from start to a state that satisfies the conditions expressed by predicate. An UpdatablePriorityQueue`2 is used to manage the list of TStates to process, to reduce the computation cost of this operator.

Loops and cycles are automatically detected and handled correctly by this operator; only the cheapest path to a given TState is used, and other paths (including loops) are discarded.

Dijkstra's algorithm assumes that all costs are positive, that is to say, that it is not possible to go a negative distance from one state to the next. Violating this assumption will have undefined behavior.

This method will operate on an infinite map, however, performance will depend on how many states are required to be evaluated before reaching the target point.

This operator executes immediately.

GetShortestPathCost``2(start,getNeighbors,end) method

Summary

Calculate the cost of the shortest path from state start to state end, using the A* algorithm.

Returns

The traversal cost of the shortest path from start to end.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1,``1}}} A function that returns the neighbors for a given state;
the total cost to get to that state based on the
traversal cost at the current state; and the predicted
or best-guess total (already traversed plus remaining)
cost to get to end.
end ``0 The target state
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Exceptions
Name Description
System.ArgumentNullException getNeighbors is null.
System.InvalidOperationException The map is entirely explored and no path to end is found.
Remarks

This method uses the A* algorithm to explore a map and find the shortest path from start to end. An UpdatablePriorityQueue`2 is used to manage the list of TStates to process, to reduce the computation cost of this operator. Overall performance of this method will depend on the reliability of the best-guess cost provided by getNeighbors.

Loops and cycles are automatically detected and handled correctly by this operator; only the cheapest path to a given TState is used, and other paths (including loops) are discarded.

The A* algorithm assumes that all costs are positive, that is to say, that it is not possible to go a negative distance from one state to the next. Violating this assumption will have undefined behavior.

This method will operate on an infinite map, however, performance will depend on how many states are required to be evaluated before reaching the target point.

This method uses Default to compare TStates and Default to compare traversal TCosts.

This operator executes immediately.

GetShortestPathCost``2(start,getNeighbors,end,stateComparer,costComparer) method

Summary

Calculate the cost of the shortest path from state start to state end, using the A* algorithm.

Returns

The traversal cost of the shortest path from start to end.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1,``1}}} A function that returns the neighbors for a given state;
the total cost to get to that state based on the
traversal cost at the current state; and the predicted
or best-guess total (already traversed plus remaining)
cost to get to end.
end ``0 The target state
stateComparer System.Collections.Generic.IEqualityComparer{``0} A custom equality comparer for TState
costComparer System.Collections.Generic.IComparer{``1} A custom comparer for TCost
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Exceptions
Name Description
System.ArgumentNullException getNeighbors is null.
System.InvalidOperationException The map is entirely explored and no path to end is found.
Remarks

This method uses the A* algorithm to explore a map and find the shortest path from start to end. An UpdatablePriorityQueue`2 is used to manage the list of TStates to process, to reduce the computation cost of this operator. Overall performance of this method will depend on the reliability of the best-guess cost provided by getNeighbors.

Loops and cycles are automatically detected and handled correctly by this operator; only the cheapest path to a given TState is used, and other paths (including loops) are discarded.

The A* algorithm assumes that all costs are positive, that is to say, that it is not possible to go a negative distance from one state to the next. Violating this assumption will have undefined behavior.

This method will operate on an infinite map, however, performance will depend on how many states are required to be evaluated before reaching the target point.

This operator executes immediately.

GetShortestPathCost``2(start,getNeighbors,predicate) method

Summary

Calculate the cost of the shortest path from state start to a state that satisfies the conditions expressed by predicate, using the A* algorithm.

Returns

The traversal cost of the shortest path from start to a state that satisfies the conditions expressed by predicate.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1,``1}}} A function that returns the neighbors for a given state; the total cost to get to that state based on the
traversal cost at the current state; and the predicted or best-guess total (already traversed plus remaining)
cost to get to a state that satisfies the conditions expressed by predicate.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Exceptions
Name Description
System.ArgumentNullException getNeighbors is null.
System.InvalidOperationException The map is entirely explored and no state that satisfies the
conditions expressed by predicate is found.
Remarks

This method uses the A* algorithm to explore a map and find the shortest path from start to a state that satisfies the conditions expressed by predicate. An UpdatablePriorityQueue`2 is used to manage the list of TStates to process, to reduce the computation cost of this operator. Overall performance of this method will depend on the reliability of the best-guess cost provided by getNeighbors.

Loops and cycles are automatically detected and handled correctly by this operator; only the cheapest path to a given TState is used, and other paths (including loops) are discarded.

The A* algorithm assumes that all costs are positive, that is to say, that it is not possible to go a negative distance from one state to the next. Violating this assumption will have undefined behavior.

This method will operate on an infinite map, however, performance will depend on how many states are required to be evaluated before reaching the target point.

This method uses Default to compare TStates and Default to compare traversal TCosts.

This operator executes immediately.

GetShortestPathCost``2(start,getNeighbors,predicate,stateComparer,costComparer) method

Summary

Calculate the cost of the shortest path from state start to a state that satisfies the conditions expressed by predicate, using the A* algorithm.

Returns

The traversal cost of the shortest path from start to a state that satisfies the conditions expressed by predicate.

Parameters
Name Type Description
start ``0 The starting state
getNeighbors System.Func{``0,``1,System.Collections.Generic.IEnumerable{System.ValueTuple{``0,``1,``1}}} A function that returns the neighbors for a given state; the total cost to get to that state based on the
traversal cost at the current state; and the predicted or best-guess total (already traversed plus remaining)
cost to get to a state that satisfies the conditions expressed by predicate.
predicate System.Func{``0,System.Boolean} The predicate that defines the conditions of the element to search for.
stateComparer System.Collections.Generic.IEqualityComparer{``0} A custom equality comparer for TState
costComparer System.Collections.Generic.IComparer{``1} A custom comparer for TCost
Generic Types
Name Description
TState The type of each state in the map
TCost The type of the cost to traverse between states
Clone this wiki locally