Table of Contents

Class PendingLinqExtensions

Namespace
Garyon.Extensions
Assembly
Garyon.dll

Contains functions proposed to be added to LINQ but were not.

public static class PendingLinqExtensions
Inheritance
PendingLinqExtensions
Inherited Members

Methods

Sum(IEnumerable<uint?>)

Computes the sum of a sequence of nullable uint values.

public static uint? Sum(this IEnumerable<uint?> source)

Parameters

source IEnumerable<uint?>

A sequence of nullable uint values to calculate the sum of.

Returns

uint?

The sum of the values in the sequence.

Exceptions

ArgumentNullException

source is null.

OverflowException

The sum is larger than MaxValue.

Sum(IEnumerable<ulong?>)

Computes the sum of a sequence of nullable ulong values.

public static ulong? Sum(this IEnumerable<ulong?> source)

Parameters

source IEnumerable<ulong?>

A sequence of nullable ulong values to calculate the sum of.

Returns

ulong?

The sum of the values in the sequence.

Exceptions

ArgumentNullException

source is null.

OverflowException

The sum is larger than MaxValue.

Sum(IEnumerable<uint>)

Computes the sum of a sequence of uint values.

public static uint Sum(this IEnumerable<uint> source)

Parameters

source IEnumerable<uint>

A sequence of uint values to calculate the sum of.

Returns

uint

The sum of the values in the sequence.

Exceptions

ArgumentNullException

source is null.

OverflowException

The sum is larger than MaxValue.

Sum(IEnumerable<ulong>)

Computes the sum of a sequence of ulong values.

public static ulong Sum(this IEnumerable<ulong> source)

Parameters

source IEnumerable<ulong>

A sequence of ulong values to calculate the sum of.

Returns

ulong

The sum of the values in the sequence.

Exceptions

ArgumentNullException

source is null.

OverflowException

The sum is larger than MaxValue.

Sum<TSource>(IEnumerable<TSource>, Func<TSource, uint?>)

Computes the sum of the sequence of nullable uint values that are obtained by invoking a transform function on each element of the input sequence.

public static uint? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, uint?> selector)

Parameters

source IEnumerable<TSource>

A sequence of values that are used to calculate a sum.

selector Func<TSource, uint?>

A transform function to apply to each element.

Returns

uint?

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

Exceptions

ArgumentNullException

source or selector is null.

OverflowException

The sum is larger than MaxValue.

Sum<TSource>(IEnumerable<TSource>, Func<TSource, ulong?>)

Computes the sum of the sequence of nullable ulong values that are obtained by invoking a transform function on each element of the input sequence.

public static ulong? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, ulong?> selector)

Parameters

source IEnumerable<TSource>

A sequence of values that are used to calculate a sum.

selector Func<TSource, ulong?>

A transform function to apply to each element.

Returns

ulong?

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

Exceptions

ArgumentNullException

source or selector is null.

OverflowException

The sum is larger than MaxValue.

Sum<TSource>(IEnumerable<TSource>, Func<TSource, uint>)

Computes the sum of the sequence of uint values that are obtained by invoking a transform function on each element of the input sequence.

public static uint Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, uint> selector)

Parameters

source IEnumerable<TSource>

A sequence of values that are used to calculate a sum.

selector Func<TSource, uint>

A transform function to apply to each element.

Returns

uint

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

Exceptions

ArgumentNullException

source or selector is null.

OverflowException

The sum is larger than MaxValue.

Sum<TSource>(IEnumerable<TSource>, Func<TSource, ulong>)

Computes the sum of the sequence of ulong values that are obtained by invoking a transform function on each element of the input sequence.

public static ulong Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, ulong> selector)

Parameters

source IEnumerable<TSource>

A sequence of values that are used to calculate a sum.

selector Func<TSource, ulong>

A transform function to apply to each element.

Returns

ulong

The sum of the projected values.

Type Parameters

TSource

The type of the elements of source.

Exceptions

ArgumentNullException

source or selector is null.

OverflowException

The sum is larger than MaxValue.