EnumerableRowCollectionExtensions.Where<TRow>(EnumerableRowCollection<TRow>, Func<TRow,Boolean>) 方法

定义

按指定谓词筛选行序列。Filters a sequence of rows based on the specified predicate.

此 API 支持产品基础结构,不能在代码中直接使用。

public:
generic <typename TRow>
[System::Runtime::CompilerServices::Extension]
 static System::Data::EnumerableRowCollection<TRow> ^ Where(System::Data::EnumerableRowCollection<TRow> ^ source, Func<TRow, bool> ^ predicate);
public static System.Data.EnumerableRowCollection<TRow> Where<TRow> (this System.Data.EnumerableRowCollection<TRow> source, Func<TRow,bool> predicate);
static member Where : System.Data.EnumerableRowCollection<'Row> * Func<'Row, bool> -> System.Data.EnumerableRowCollection<'Row>
<Extension()>
Public Function Where(Of TRow) (source As EnumerableRowCollection(Of TRow), predicate As Func(Of TRow, Boolean)) As EnumerableRowCollection(Of TRow)

类型参数

TRow

source 中行元素的类型,通常为 DataRowThe type of the row elements in source, typically DataRow.

参数

source
EnumerableRowCollection<TRow>

包含要筛选的 EnumerableRowCollection 元素的 DataRowAn EnumerableRowCollection containing the DataRow elements to filter.

predicate
Func<TRow,Boolean>

用于测试每个元素是否满足条件的函数。A function to test each element for a condition.

返回

一个 OrderedEnumerableRowCollection<TRow>,其中包含输入序列中满足该条件的行。An OrderedEnumerableRowCollection<TRow> that contains rows from the input sequence that satisfy the condition.

注解

此方法是使用延迟执行实现的。This method is implemented by using deferred execution. 即时返回值是一个对象,该对象存储执行操作所需的所有信息。The immediate return value is an object that stores all the information that is required to perform the action. 在枚举对象之前,不会执行由此方法表示的查询,方法是:直接调用其 @no__t 0 方法,或者使用视觉C#对象中的 @no__t 或 @no__t Visual Basic 中的。The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in Visual C# or For Each in Visual Basic.

适用于

另请参阅