Explanation why this question is different to: EF - multiple includes to eager load hierarchical data. Bad practice?
I have built stored procedure to get all childs in all levels using recursive cte stored procedure to get all childs ids of any level of self-referencing table using Entity Framework and recursive cte