返回具有最大键值的可查询可观测序列中的元素。
Namespace:System.Reactive.Linq
装配: system.Reactive.Providers 在 System.Reactive.Providers.dll) 中 (
语法
'Declaration
<ExtensionAttribute> _
Public Shared Function MaxBy(Of TSource, TKey) ( _
source As IQbservable(Of TSource), _
keySelector As Expression(Of Func(Of TSource, TKey)), _
comparer As IComparer(Of TKey) _
) As IQbservable(Of IList(Of TSource))
'Usage
Dim source As IQbservable(Of TSource)
Dim keySelector As Expression(Of Func(Of TSource, TKey))
Dim comparer As IComparer(Of TKey)
Dim returnValue As IQbservable(Of IList(Of TSource))
returnValue = source.MaxBy(keySelector, _
comparer)
public static IQbservable<IList<TSource>> MaxBy<TSource, TKey>(
this IQbservable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
IComparer<TKey> comparer
)
[ExtensionAttribute]
public:
generic<typename TSource, typename TKey>
static IQbservable<IList<TSource>^>^ MaxBy(
IQbservable<TSource>^ source,
Expression<Func<TSource, TKey>^>^ keySelector,
IComparer<TKey>^ comparer
)
static member MaxBy :
source:IQbservable<'TSource> *
keySelector:Expression<Func<'TSource, 'TKey>> *
comparer:IComparer<'TKey> -> IQbservable<IList<'TSource>>
JScript does not support generic types and methods.
类型参数
- TSource
源的类型。
- TKey
键的类型。
参数
- source
类型: System.Reactive.Linq.IQbservable<TSource>
要获取其最大元素的可查询可观测序列。
- keySelector
类型: System.Linq.Expressions.Expression<Func<TSource、TKey>>
键选择器函数。
- 比较
类型: System.Collections.Generic.IComparer<TKey>
用于比较键值的比较器。
返回值
类型: System.Reactive.Linq.IQbservable<IList<TSource>>
具有最大键值的可查询可观测序列中的元素。
使用说明
在 Visual Basic 和 C# 中,可以在 IQbservable<TSource> 类型的任何对象上调用此方法作为实例方法。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅或。