System.Linq.Enumerable.Sum Method

Computes the sum of a sequence of nullable decimal values.

Syntax

public static Nullable<decimal> Sum (this IEnumerable<Nullable<decimal>> source)

Parameters

source
A sequence of nullable decimal values to calculate the sum of.

Returns

The sum of the values in the sequence.

Remarks

This method returns zero if source contains no elements.

The result does not include values that are null.

In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of erload:System.Linq.Enumerable.Sum.

Requirements

Namespace: System.Linq
Assembly: System.Core (in System.Core.dll)
Assembly Versions: 3.5.0.0, 4.0.0.0