ken*_*n2k 16
使用LINQ:
bool contains = yourList.Any(z => z.YouProperty > yourValue);
Run Code Online (Sandbox Code Playgroud)
您可以使用Enumerable.Any<TSource
> 方法。它返回boolean
。
确定序列是否包含任何元素。
Return Value
Type: System.Boolean
true if the source sequence contains any elements; otherwise, false.
List.Any(a => a.Property > Value);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6351 次 |
最近记录: |