C#(一) Linq表达式
时间:2022-11-03 11:00:00
筛选分数大于80,升序排列
List scores = new List { 5, 200, 0, 66, 4, 32, 700, 1 }; IEnumerable highScoresQuery = from score in scores where score > 80 orderby score ascending select score; //ascending 升序排列 //descending 降序排列
或直接筛选不排序
var result = scores.Where(c => c>80).ToList();
Join 参考https://mp.weixin.qq.com/s/Bf_cHt7Yl1yBudbQKOhdTg
let 参考https://mp.weixin.qq.com/s/AUwbq7gWGZa9K4W0SGhEfA