I have three entities as shown below.
Student { StudentID, Name, Age }
Parent { ParentID, Name, Age }
StudentParent { StudentParentID, StudentID, ParentID }
I need to get an IQueryable list of students that are a certain age and have no parents. I am currently using the following code which does work.
IQueryable<Student> Student s = from s in db.Students
where s.Age == 18
where !(from sp in db.StudentParent where sp.StudentID == s.StudentID select sp.StudentID).Contains(s.StudentID)
select s;
I would just like help converting this to a Lambda expression.