I have "googled" for many hour but still I am not able to find an answer. Basically, I have a table that looks like this:
Parent | ID
null | 1
1 | 2
2 | 3
3 | 4
3 | 5
3 | 6
4 | 7
null | 8
How can I use entity linq to filter based on Id and "depth level" (which is a simple count of elements including the Id element and n - 1 elements passed the Id element)?
For example when I pass Id 2 and depth level 2
Result will be
Parent | ID
2 | 3 //level 1
3 | 4 //level 2
3 | 5 //level 2
3 | 6 //level 2
If I pass Id 3 and depth level also 2
Result will be
Parent ID
3 | 4 //level 1
3 | 5 //level 1
3 | 6 //level 1
4 | 7 //level 2
Thanks for your help