先看例子再做一个简单解释吧。
using System;
using System.Linq;
namespace Com.LoonStudio {
class Program {
static void Main(string[] args) {
int[] x = { 13, 36, 5, 29, 10, 12, 40, 56 };
var y = from temp in x where temp % 2 == 0 orderby temp select temp;
foreach (int z in y) {
Console.Write(z + "\t");
}
Console.WriteLine();
}
}
}
using System;
using System.