Skip to content

,System.Int32)}

Qbservable.ElementAtOrDefault(IQbservable, int) method

Defined in

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

Applies to

netstandard2.0

public static IQbservable<TSource?> ElementAtOrDefault<TSource>(this IQbservable<TSource> source, int index)

Summary: Returns the element at a specified index in a sequence or a default value if the index is out of range.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#Observable sequence to return the element from.
indexintThe zero-based index of the element to retrieve.

Returns: IQbservable -- An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptionindex is less than zero.