linq syntax
Hi,
I just downloaded linqpad and am trying to do the first test. The language I selected is C# expression. The linq query is as followed,
from p in Patients where p.patDOBirth > new DateTime(2010, 1, 1) group p by p.patGender into genderGroup
select new PatientGroup() {
name = genderGroup.patOthername + ' ' + genderGroup.patSurname,
Count = genderGroup.Count()
}
I got error messages
1) The type or namespace name 'PatientGroup' could not be found (press F4 to add a using directive or assembly reference)
2) model doesn't contain patOthername
3) model doesn't contain patSurname
The patOthername and patSurname do exist.
Thank you!
I just downloaded linqpad and am trying to do the first test. The language I selected is C# expression. The linq query is as followed,
from p in Patients where p.patDOBirth > new DateTime(2010, 1, 1) group p by p.patGender into genderGroup
select new PatientGroup() {
name = genderGroup.patOthername + ' ' + genderGroup.patSurname,
Count = genderGroup.Count()
}
I got error messages
1) The type or namespace name 'PatientGroup' could not be found (press F4 to add a using directive or assembly reference)
2) model doesn't contain patOthername
3) model doesn't contain patSurname
The patOthername and patSurname do exist.
Thank you!
Comments
select new { name = genderGroup.patOthername + ' ' + genderGroup.patSurname, Count = genderGroup.Count() }