Reputation: 5546
table people: SSN, name table students: SSN, school
I want to get all SSN for people who are not students. How do I write this with entity framework?
Upvotes: 4
Views: 13543
Reputation: 160992
var ssnList = Context.Peoples
.Where( p => !Context.Students
.Any(s => s.SSN == p.SSN))
.Select( p => p.SSN).ToList();
Upvotes: 7