日期:2014-05-20 浏览次数:20754 次
List<Employee> employee = new List<Employee>{ new Employee{ID = 1,Name = "aaa",City = "x",Address = "ding",Value =100}, new Employee{ID = 2,Name = "bbb",City = "y",Address = "dang",Value =200}, new Employee{ID = 3,Name = "ccc",City = "z",Address = "kacha",Value =300}, new Employee{ID = 4,Name = "ddd",City = "y",Address = "wag",Value =200}, new Employee{ID = 5,Name = "eee",City = "z",Address = "ping",Value =300} }; var query = employee.Where(x=> x.Address.StartsWith("d") || x.Value == 300); var query1 = employee.Where(x => x.Address.StartsWith("d")).Union(employee.Where(x => x.Value == 300)); foreach (var q in query) { Console.Write(q.Name.ToString() + "\r\n"); } Console.WriteLine("-----------"); foreach (var q in query1) { Console.Write(q.Name.ToString() + "\r\n"); }
------解决方案--------------------
不明白啥意思
------解决方案--------------------
http://topic.csdn.net/u/20080912/10/2CBCF3AF-9AD7-42D4-BD16-2EA9B6E189AF.html