I have two entities
User { UserID, Name, UserTypeID }
StudentParent { StudentParentID, StudentID, ParentID }
// where
UserTypeID { 1=student, 2=parent }
Both StudentParent.StudentID and StudentParent.ParentID are foreign keys pointing to User.UserID
I have a list of Students (IEnumerable<User>) that I need to get the list of parents for. I need help figuring out the proper expression to get the list of parents.
Should I be using a contains or any statement to match against the list of Student Users?
You should be able to
SelecttheParententites from yourIEnumerableof students.This performs a projection from your collection of students, not all
Students.Logically it is something like
It also may be more useful to select into an anonymous type so you can see which parents belong to which students.