Skip to content

,--0)}

Qbservable.MostRecent(IQbservable, TSource) method

Defined in

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

Applies to

netstandard2.0

public static IQueryable<TSource> MostRecent<TSource>(this IQbservable<TSource> source, TSource initialValue)

Summary: Returns an enumerable sequence whose enumeration returns the most recently observed element in the source observable sequence, using the specified initial value in case no element has been sampled yet. Enumerators on the resulting sequence never block and can produce the same element repeatedly.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#Source observable sequence.
initialValueTSourceInitial value that will be yielded by the enumerable sequence if no element has been sampled yet.

Returns: IQueryable -- The enumerable sequence that returns the last sampled element upon each iteration.

Remarks

This operator requires the source's IQbservableProvider object (see Provider) to implement IQueryProvider.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.