Observable.ElementAtOrDefault(IObservable, int) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
public static IObservable<TSource?> ElementAtOrDefault<TSource>(this IObservable<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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Observable sequence to return the element from. |
index | int | The zero-based index of the element to retrieve. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | index is less than zero. |