Computes the sum of the sequence of
Nullable T values that are obtained by invoking a transform function on each element of the input sequence.
If the source sequence represents an infinite set or series, this will never return!
Namespace: SequencesAssembly: Sequences (in Sequences.dll) Version: 1.0.1.0 (1.0.1)
Syntax public static Nullable<BigInteger> Sum<TSource>(
this ISequence<TSource> source,
Func<TSource, Nullable<BigInteger>> selector
)
public static Nullable<BigInteger> Sum<TSource>(
this ISequence<TSource> source,
Func<TSource, Nullable<BigInteger>> selector
)
<ExtensionAttribute>
Public Shared Function Sum(Of TSource) (
source As ISequence(Of TSource),
selector As Func(Of TSource, Nullable(Of BigInteger))
) As Nullable(Of BigInteger)
<ExtensionAttribute>
Public Shared Function Sum(Of TSource) (
source As ISequence(Of TSource),
selector As Func(Of TSource, Nullable(Of BigInteger))
) As Nullable(Of BigInteger)
public:
[ExtensionAttribute]
generic<typename TSource>
static Nullable<BigInteger> Sum(
ISequence<TSource>^ source,
Func<TSource, Nullable<BigInteger>>^ selector
)
public:
[ExtensionAttribute]
generic<typename TSource>
static Nullable<BigInteger> Sum(
ISequence<TSource>^ source,
Func<TSource, Nullable<BigInteger>>^ selector
)
static member Sum :
source : ISequence<'TSource> *
selector : Func<'TSource, Nullable<BigInteger>> -> Nullable<BigInteger>
static member Sum :
source : ISequence<'TSource> *
selector : Func<'TSource, Nullable<BigInteger>> -> Nullable<BigInteger>
Parameters
- source
- Type: Sequences ISequence TSource
A sequence of values that are used to calculate a sum.
- selector
- Type: System Func TSource, Nullable BigInteger
Type Parameters - TSource
- The type of the elements of source.
Return Value
Type:
Nullable BigInteger A transform function to apply to each element.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ISequence TSource . When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also