I'm trying to group and still retrieve all the data in the table. I'm still pretty new to Linq and can't seem to tell what I'm doing wrong. I not only want to group the results but I still want to retrieve all the columns in the table. Is this possible?
(from r in db.Form
orderby r.CreatedDate descending
group r by r.Record into myGroup
where myGroup.Count() > 0
where (r.CreatedDate > lastmonth)
where r.Name == "Test Name"
select new { r, myGroup.Key, Count = myGroup.Count() }
)
Some how "r" loses its context or since I grouped "r" it has been replaced. Not sure.