【发布时间】:2016-08-24 09:41:49
【问题描述】:
我有一个包含项目的列表(假设有 1000 个项目)。我想从该列表中选择TimeInSecond 匹配条件的数据。
newList = oldList.Where(x => x.TimeInSecond >= 30 && x.TimeInSecond <= 90).ToList();
// the above query returns 20 items (from 10 to 20)
但是,我需要从oldList 中追加下一个N 行数
// This is just an example of what I need, for example 10 next more items
newList = oldList.Where(x => x.TimeInSecond >= 30 && x.TimeInSecond <= 90).GetNextMoreItems(10).ToList() ;
// the above query returns (20 + 10) 30 items (from 1 to 30)
【问题讨论】:
-
不清楚您需要什么。你拿了那些与
where匹配的项目,然后你也只想要其他 10 个随机的? -
@GiladGreen 是对的。
-
大概
GetNextMoreItems()应该返回不满足条件的项目? -
@stuartd 对!接下来的N项是否符合条件都没有关系,