Skip to content

)} )} )} )} })} })} })} })} })} )} ,System.Linq.Expressions.Expression{System.Func{--0,System.Double}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Single}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Decimal}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int64}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Nullable{System.Double}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Nullable{System.Single}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Nullable{System.Decimal}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Nullable{System.Int32}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Nullable{System.Int64}}})}

Qbservable.Sum(IQbservable) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<decimal> Sum(this IQbservable<decimal> source)
  • 2. public static IQbservable<double> Sum(this IQbservable<double> source)
  • 3. public static IQbservable<int> Sum(this IQbservable<int> source)
  • 4. public static IQbservable<long> Sum(this IQbservable<long> source)
  • 5. public static IQbservable<decimal?> Sum(this IQbservable<decimal?> source)
  • 6. public static IQbservable<double?> Sum(this IQbservable<double?> source)
  • 7. public static IQbservable<int?> Sum(this IQbservable<int?> source)
  • 8. public static IQbservable<long?> Sum(this IQbservable<long?> source)
  • 9. public static IQbservable<float?> Sum(this IQbservable<float?> source)
  • 10. public static IQbservable<float> Sum(this IQbservable<float> source)
  • 11. public static IQbservable<double> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double>> selector)
  • 12. public static IQbservable<float> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float>> selector)
  • 13. public static IQbservable<decimal> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal>> selector)
  • 14. public static IQbservable<int> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int>> selector)
  • 15. public static IQbservable<long> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long>> selector)
  • 16. public static IQbservable<double?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double?>> selector)
  • 17. public static IQbservable<float?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float?>> selector)
  • 18. public static IQbservable<decimal?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal?>> selector)
  • 19. public static IQbservable<int?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int?>> selector)
  • 20. public static IQbservable<long?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long?>> selector)

1. Overload

public static IQbservable<decimal> Sum(this IQbservable<decimal> source)

Summary: Computes the sum of a sequence of Decimal values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of Decimal values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

2. Overload

public static IQbservable<double> Sum(this IQbservable<double> source)

Summary: Computes the sum of a sequence of Double values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of Double values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

3. Overload

public static IQbservable<int> Sum(this IQbservable<int> source)

Summary: Computes the sum of a sequence of Int32 values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of Int32 values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

4. Overload

public static IQbservable<long> Sum(this IQbservable<long> source)

Summary: Computes the sum of a sequence of Int64 values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of Int64 values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

5. Overload

public static IQbservable<decimal?> Sum(this IQbservable<decimal?> source)

Summary: Computes the sum of a sequence of nullable Decimal values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of nullable Decimal values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

6. Overload

public static IQbservable<double?> Sum(this IQbservable<double?> source)

Summary: Computes the sum of a sequence of nullable Double values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of nullable Double values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

7. Overload

public static IQbservable<int?> Sum(this IQbservable<int?> source)

Summary: Computes the sum of a sequence of nullable Int32 values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of nullable Int32 values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

8. Overload

public static IQbservable<long?> Sum(this IQbservable<long?> source)

Summary: Computes the sum of a sequence of nullable Int64 values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of nullable Int64 values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

9. Overload

public static IQbservable<float?> Sum(this IQbservable<float?> source)

Summary: Computes the sum of a sequence of nullable Single values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of nullable Single values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

10. Overload

public static IQbservable<float> Sum(this IQbservable<float> source)

Summary: Computes the sum of a sequence of Single values.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of Single values to calculate the sum of.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

11. Overload

public static IQbservable<double> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.

12. Overload

public static IQbservable<float> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.

13. Overload

public static IQbservable<decimal> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.

14. Overload

public static IQbservable<int> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.

15. Overload

public static IQbservable<long> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.

16. Overload

public static IQbservable<double?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, double?>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.

17. Overload

public static IQbservable<float?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, float?>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.

18. Overload

public static IQbservable<decimal?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal?>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.

19. Overload

public static IQbservable<int?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int?>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.

20. Overload

public static IQbservable<long?> Sum<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long?>> selector)

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

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#A sequence of values that are used to calculate a sum.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the sum of the values in the source sequence.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.