Linq实现分组后取最大(小)值
var beatles = (new[] { new { inst = "张三" , age="50" }, new { inst = "张三" , age="20" }, new { inst = "何英" , age="35" }, new { inst = "张三" , age="60" }, new { inst = "何英" , age="18" } }); var o11 = from d in beatles group d by d.inst into g select new { Id = g.Max(m => m.age), Name = g.Key };
一份耕耘,一份收获,付出就有回报永不遭遇过失败,因我所碰到的都是暂时的挫折