title: Nested Select in LINQ with Lambda Expression
body: <p>I have two sequence of objects; namely <code>Messages</code> for <code>Message</code> object and <code>Newsflashes</code> for <code>Newsflash</code> object.</p>
  
  <p>Both are derived through Entity Framework ADO.NET Entity Model. The diagram of the model is as below:
  <img src="https://i.stack.imgur.com/SHLj9.png" alt="enter image description here"></p>
  
  <p>As you can see, the <code>Newsflash</code> inherits from <code>Message</code>. However, the generated Index in the controller somehow error and I need to do manual query to pass the right sequence to the View.</p>
  
  <p>The <code>Newsflash</code> table only has one column, which is Id and at the same time a foreign key to the <code>Message</code> Id.
  I want to query like this in LINQ <code>SELECT * FROM MESSAGE WHERE ID IN (SELECT ID FROM NEWSFLASH)</code></p>
  
  <p>So far I have tried something like this:
  <code>var message = Messages.Where(x =&gt; x.Id == Newsflash.Any(y=&gt;y.Id))</code></p>
  
  <p>But I am getting error that cannot convert int to bool. What did I do wrong? How do nested select especially from a list is handled in LINQ? How can I access element in the sequence; in this case <code>Newsflash</code> so that I could get the Id individually?</p>