linq查询方法 [英] linq to query method
本文介绍了linq查询方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
int [] nums = {1, -2, 3, 0, -4, 5};
var posNums = from n in nums where n > 0 select n;
你好,我如何使用Query方法进行编码
hello, how can i code with Query method
推荐答案
你的意思是:
int [] nums = {1, -2, 3, 0, -4, 5};
var posNums = nums.Where(n => n > 0);
这篇关于linq查询方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文