Question: I am using Entity Framework where I want to fetch all the parent records which doesn't have child record.

How to query the same?

Parent Table -> "Messages"
 Child Table - > "SentMessages"

EDIT: 
Please note: I need th solution in Entity Framework classes. 

Currently I am using -

```
ctx.Messages.Where(m => ctx.SentMessages(x => x.msgid != m.msgid))

```

but it failed

Answer: 
You can try this LINQ,

```
MessageList.Where(m => !SentMessageList.Select(sm => sm.MsgId).Contains(m.MsgId));

```
in pseudo code:

```
from m in Messages
where m.Sents.Count() == 0
select m

```