Skip to content

Is it able to extract certain sub tree after calling TransformToTree? #882

Closed Answered by Snailya
Snailya asked this question in Q&A
Discussion options

You must be logged in to vote

I've figured out the correct way is to create a predicate function for TransformToTree.
The default predicate for the TransformToTree example is

Observable.Return((Node<EmployeeDto, int> node) => node.IsRoot);

For my situation, is to build a predicate based on the id of the node.

var categoryPredicate = this.WhenAnyValue(x => x.ElementName)
                            .Select((string name) => Node<EmployeeDto, int> node) => service.GetValidIds(name).Contains(node.Id));

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Snailya
Comment options

You must be logged in to vote
1 reply
@Snailya
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants