That's pretty much identical to an ORM:
db.Users .Inlude(u => Posts) .Select(u => new { u.Id, Count = u.Posts.Count()});