Skip to content

,System.Func{--0,--1})} ,System.Func{--0,--1},System.Collections.Generic.IComparer{--1})}

Observable.MinBy(IObservable, Func) method

Defined in

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

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<IList<TSource>> MinBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
  • 2. public static IObservable<IList<TSource>> MinBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer)

1. Overload

public static IObservable<IList<TSource>> MinBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)

Summary: Returns the elements in an observable sequence with the minimum key value.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TKeyThe type of the key computed for each element in the source sequence.

Parameters

NameTypeDescription
sourceIObservableAn observable sequence to get the minimum elements for.
keySelectorFuncKey selector function.

Returns: IObservable> -- An observable sequence containing a list of zero or more elements that have a minimum key value.

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

2. Overload

public static IObservable<IList<TSource>> MinBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer)

Summary: Returns the elements in an observable sequence with the minimum key value according to the specified comparer.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TKeyThe type of the key computed for each element in the source sequence.

Parameters

NameTypeDescription
sourceIObservableAn observable sequence to get the minimum elements for.
keySelectorFuncKey selector function.
comparerIComparerComparer used to compare key values.

Returns: IObservable> -- An observable sequence containing a list of zero or more elements that have a minimum key value.

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 keySelector or comparer is null.