通过合并元素的索引,基于谓词筛选可查询可观测序列的元素。
Namespace:System.Reactive.Linq
装配: System.Reactive.Providers.dll) 中的 System.Reactive.Providers (
语法
'Declaration
<ExtensionAttribute> _
Public Shared Function Where(Of TSource) ( _
source As IQbservable(Of TSource), _
predicate As Expression(Of Func(Of TSource, Integer, Boolean)) _
) As IQbservable(Of TSource)
'Usage
Dim source As IQbservable(Of TSource)
Dim predicate As Expression(Of Func(Of TSource, Integer, Boolean))
Dim returnValue As IQbservable(Of TSource)
returnValue = source.Where(predicate)
public static IQbservable<TSource> Where<TSource>(
this IQbservable<TSource> source,
Expression<Func<TSource, int, bool>> predicate
)
[ExtensionAttribute]
public:
generic<typename TSource>
static IQbservable<TSource>^ Where(
IQbservable<TSource>^ source,
Expression<Func<TSource, int, bool>^>^ predicate
)
static member Where :
source:IQbservable<'TSource> *
predicate:Expression<Func<'TSource, int, bool>> -> IQbservable<'TSource>
JScript does not support generic types and methods.
类型参数
- TSource
类型源。
参数
- source
类型: System.Reactive.Linq.IQbservable<TSource>
要筛选其元素的可查询可观察序列。
- predicate
类型: System.Linq.Expressions.Expression<Func<TSource、 Int32、 Boolean>>
用于测试每个源元素是否满足条件的函数;该函数的第二个参数表示源元素的索引。
返回值
类型: System.Reactive.Linq.IQbservable<TSource>
一个可查询的可观察序列,其中包含满足条件的输入序列中的元素。
使用说明
在 Visual Basic 和 C# 中,可以将此方法作为 IQbservable<TSource> 类型的任何对象的实例方法调用。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅或。