Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想按组对所有用户名进行分组。我试过了 :
var query = from u in db.Users group p by u.UserGroup select u.FullName;
我该如何解决?
这将返回匿名对象序列,包含 UserGroup 和该组中的所有名称:
var query = from u in db.Users group u by u.UserGroup into g select new { UserGroup = g.Key, Names = g.Select(x => x.FullName) };