Issue sending parent Id through recursive function
I have a function that goes through provided nested enumerable with varying depth.
It returns element that pass the given condition.
I'm having issue with child elements to have I'd of the parent. For that, I am trying to pass Id of found valid element through the preceding recursion but it's having 0 for all the elements.
8 Replies
Yes trying, thank you for advice
parentId is not used after the assignment, you are passing element.Order instead
yes sorry, it seems I pasted older code. I did use parentId, but that also gives 0
I've updated the code

set a breakpoint in the assignment and check what element.Order actually is, maybe it's zero
element.Order is also assigned to ID for current element in
element.ToTableElement(parentId);
and in sample output, you can see the ID which infact is element.Orderwell, if ToTableElement also sets element.Order to parentId, it would always be zero