Skip to content

)} ,System.Linq.Expressions.Expression})}

Qbservable.LongCount(IQbservable) method

Defined in

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

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<long> LongCount<TSource>(this IQbservable<TSource> source)
  • 2. public static IQbservable<long> LongCount<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, bool>> predicate)

1. Overload

public static IQbservable<long> LongCount<TSource>(this IQbservable<TSource> source)

Summary: Returns an observable sequence containing an Int64 that represents the total number of elements in an observable sequence.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence that contains elements to be counted.

Returns: IQbservable -- An observable sequence containing a single element with the number of elements in the input 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 number of elements in the source sequence is larger than MaxValue.

2. Overload

public static IQbservable<long> LongCount<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, bool>> predicate)

Summary: Returns an observable sequence containing an Int64 that represents how many elements in the specified observable sequence satisfy a condition.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence that contains elements to be counted.
predicateExpression>A function to test each element for a condition.

Returns: IQbservable -- An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function.

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 predicate is null.