我在SQL中有表
id datetime
---|------------|
1 | January |
2 | February |
3 | March |
4 | April |
5 | May |
6 | June |
7 | July |
8 | August |
9 | September |
10 | October |
11 | November |
12 | December |
当选择记录结果从一月开始但我想获取完整记录但从七月开始...
答案 0 :(得分:0)
您想从7月开始,所以首先列出从7月开始的清单。然后将其与其余项目合并。
尝试一下
var result = modelList.Where(x => x.id > 6).ToList().
Union(modelList.Where(y => y.id < 7).Distinct().ToList()).ToList();