In Nested Set Model, there's a challenge for me to convert sql to linq.
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.
SELECT DISTINCT Child.Name
FROM ModelTable AS Child, ModelTable AS Parent
WHERE Parent.Lft < Child.Lft AND Parent.Rgt > 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
I'm stuck with expressing it with LINQ, so I'm on my knees to learn from you.