Skip to content

)} )} )} )} })} })} })} })} })} )} ,System.Linq.Expressions.Expression{System.Func{--0,System.Decimal}})} ,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.Int32}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int64}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Nullable{System.Decimal}}})} ,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.Int32}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Nullable{System.Int64}}})}

Qbservable.Average(IQbservable) method

Defined in

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

Applies to

netstandard2.0

Overloads

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

1. Overload

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

Summary: Computes the average of an observable sequence of Decimal values.

Parameters

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

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

2. Overload

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

Summary: Computes the average of an observable sequence of Double values.

Parameters

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

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.

3. Overload

public static IQbservable<double> Average(this IQbservable<int> source)

Summary: Computes the average of an observable sequence of Int32 values.

Parameters

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

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

4. Overload

public static IQbservable<double> Average(this IQbservable<long> source)

Summary: Computes the average of an observable sequence of Int64 values.

Parameters

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

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

5. Overload

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

Summary: Computes the average of an observable sequence of nullable Decimal values.

Parameters

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

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

6. Overload

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

Summary: Computes the average of an observable sequence of nullable Double values.

Parameters

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

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.

7. Overload

public static IQbservable<double?> Average(this IQbservable<int?> source)

Summary: Computes the average of an observable sequence of nullable Int32 values.

Parameters

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

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

8. Overload

public static IQbservable<double?> Average(this IQbservable<long?> source)

Summary: Computes the average of an observable sequence of nullable Int64 values.

Parameters

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

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the elements in the source sequence is larger than MaxValue.

9. Overload

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

Summary: Computes the average of an observable sequence of nullable Single values.

Parameters

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

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.

10. Overload

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

Summary: Computes the average of an observable sequence of Single values.

Parameters

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

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.

11. Overload

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

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.

12. Overload

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

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.

13. Overload

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

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.

14. Overload

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

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.
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<double> Average<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long>> selector)

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

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

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.InvalidOperationException(Asynchronous) The source sequence is empty.
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<decimal?> Average<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, decimal?>> selector)

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.

17. Overload

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

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.

18. Overload

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

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.

19. Overload

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

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.
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<double?> Average<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, long?>> selector)

Summary: Computes the average of an observable 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 to calculate the average of.
selectorExpression>A transform function to apply to each element.

Returns: IQbservable -- An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

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.InvalidOperationException(Asynchronous) The source sequence is empty.
System.OverflowException(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue.