Group and GroupJoin operator in LINQ RRS feed

  • Question

  • Dear All,


    i am unable to understand the concept of Group and GroupJoin in linq. Can any one explain it so that i can understand it. following is the query which i copied from a book and still unable to understand it after couple of readings

    var query = from p in people join r in roles on p.IDRole equals r.ID into pr

                    from r in pr.DefaultIfEmpty()

                   select new { p.FirstName,p.LastName,RoleDescription = r == null ?"No Role" : r.RoleDescription};


    thanks in advance

    Monday, April 11, 2011 12:40 PM