This table can reference itself with ParentID => ID. Now, let's say you have a method that can look up this object by the id, and it takes a boolean as to whether or not to return the children as well:
Using a ternary operator we can write a LINQ statement like this:
var items = from x in CoolObjects
where (returnChildren ? u.ID == id || u.ParentID == id : u.ID == id)
select new CoolObject
Name = u.Name,
Pretty simple! Enjoy!