开发者

Entity Framework query to select

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?


var ssnList = Context.Peoples
                     .Where( p => !Context.Students
                                          .Any(s => s.SSN == p.SSN))
                     .Select( p => p.SSN).ToList();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜