title: Linq to get immediate children in Nested Set Model
body: <p>In <a href="http://en.wikipedia.org/wiki/Nested_set_model" rel="nofollow">Nested Set Model</a>, there's a challenge for me to convert sql to linq.</p>
  
  <p>The above wikipedia link shows how to list up immediate children of given node as below sql syntax, and it works well when I test it with LinqPad.</p>
  
  <pre><code>SELECT DISTINCT Child.Name
  FROM ModelTable AS Child, ModelTable AS Parent 
  WHERE Parent.Lft &lt; Child.Lft AND Parent.Rgt &gt; Child.Rgt  -- associate Child Nodes with ancestors
  GROUP BY Child.Name
  HAVING MAX(Parent.Lft) = 16  -- Subset for those with the given Parent Node as the nearest ancestor
  </code></pre>
  
  <p>I'm stuck with expressing it with LINQ, so I'm on my knees to learn from you.  </p>