from c in db.customers
let thecount = c.orders.count()
select new {c.fname, c.lname, thecount}

these access operations translate to more complicated joins or correlated sub-queries in the equivalent sql, allowing you to walk through your object graph during a query.


from c in customers
join o in orders on c.customerid equals o.customerid into g
select new { c.fname, c.lname, count=g.count() }

Related Query

More Query from same tag