关于LINQ一个简单例子


using
System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var A = new[] { 3, 4, 6, 7 }; var B = new[] { 2, 2, 3, 5, 1 }; var somInts = from a in A from b in B where a > 4 && b <= 2 select new { a, b, sum = a + b }; foreach (var a in somInts) { Console.WriteLine(a); } Console.Read(); } } }
原文地址:https://www.cnblogs.com/AiYaTou/p/4865459.html