title: How to work with foreign keys when using Entity Framework code first
body: <p>I create a <code>Menu</code> class that has a self-relation.</p>
  
  <pre><code>Public Class Menu
      Sub New()
          Me.lstmenu = New List(Of Menu)
      End Sub
      Property MenuID As Integer
      Property Title As String
      Property Description As String
      Property URL As String
      Property lstmenu As ICollection(Of Menu)
  End Class
  </code></pre>
  
  <p>Entity Framework code-first creates a table from this class with a self relation.</p>
  
  <p><a href="https://i.stack.imgur.com/l358p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l358p.png" alt="SQL table made by code first"></a></p>
  
  <p>I want to write a query with Linq to return me all menus that their foreign key are null but all I have is a lstmenu that hold a list of menus. And I can't find any FK column to use in my query.</p>
  
  <p>Please help me how to write a query to find all records that their foreign key are null.</p>