也说Linq 分组

看一个例子:from p in Products group p by p.Family  into g select g

image

那么:

   1:  from p in Products group p by p.Family  into g select g.First()
   2:  (from p in Products group p by p.Family into g select g).First()

什么结果呢?

from p in Products group p by p.Family  into g select g.First():

 image
(from p in Products group p by p.Family into g select g).First():

image

原文地址:https://www.cnblogs.com/jimson/p/Linq.html