score:2

A friend of mine just helped me out on this:

var q = db2.cp_users.SelectMany(
          u => u.cp_groups.Select(
              g => new { Username = u.name, Groupname = g.name }));

Works fine for me. Is there any way to do this in query syntax?

score:1

In query syntax:

from u in db2.cp_users
from g in u.cp_groups
select new { Username = u.name, GroupName = g.name }

Related Articles