摘要:
class Program { static void Main(string[] args) { string[] currentVideoGames = {"Morrowing","BloShock","Half life 2","Episode 1","The Darkness","Daxter" }; var subset = from q in currentVideoGames where q.Length > 6 ... 阅读全文
摘要:
///定义Car类型 public class Car { public string PetName = string.Empty; public string Color = string.Empty; public int Speed; public string Make = string.Empty; } ArrayList myCars = new ArrayList() { new Car{PetName="Henry",Color="Silver",Speed=100,Make="BMW"... 阅读全文
摘要:
延迟执行 static void QueryOverInts() { int[] numbers = new int[] {10,20,30,40,1,2,3,8}; //获取偶数 var subset = from q in numbers where q % 2 == 0 select q; //linq语句在这个地方执行,前面的from语句没有真正的运算,这叫做的linq的延迟执... 阅读全文