from a in numbersA, b in numbersB 编译出错.
int[] numbersA = { 0, 2, 4, 5, 6, 8, 9 };
int[] numbersB = { 1, 3, 5, 7, 8 };
var pairs =
from a in numbersA, b in numbersB
where a < b
select new { a, b };
这样查询不可以吗?为什么编译不通过?
------解决方案--------------------
因为你写的不符合linq规范。
int[] numbersA = { 0, 2, 4, 5, 6, 8, 9 };
int[] numbersB = { 1, 3, 5, 7, 8 };
var pairs =
from a in numbersA
from b in numbersB
where a < b
select new { a, b };