I\'m quite new at Linq queries, I just want to convert my DB query into Linq.
Here is my simple SQL query:
var query = \"SELECT EnrollmentDate, COUNT(*)
var result = db.Person
.Where(r=> r.EnrollmentDate != null)
.GroupBy(r=> r.EnrollmentDate)
.Select( group=> new
{
EnrollmentDate = group.Key,
Count = group.Count()
});
var query = from row in db.Person
where row.EnrollmentDate != null
group row by row.EnrollmentDate into grp
select new {
EnrollmentDate = grp.Key,
Count = grp.Count()
};