The venerable "group by" option nicely handles multiple group by fields. The Problem : What if I want to include field(s) in the result set (that don't need to be grouped by) that are not in the group by (grp) object. Based on the gazillion examples out there, it doesn't appear to handle the situation.
In the below example all of the group by fields are nicely included in the result set using the grp object. OK, so let's say "addresses" has a "street" or "phone" that I simply want to include in the result without grouping. Options?
var qry = from addr in addresses
group addr by new { addr.city, addr.state, addr.country } into grp
select new
{
city = grp.Key.city,
state = grp.Key.state,
country = grp.Key.country,
count = grp.Count(),
};