-
-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Hi Skclusive,
Sorry if this isn't the right way to ask, but I've been struggling with something. I need to track an object that has child-objects that have their own behaviours. Trunck > Branch > Leaf. They all have their own EditName/EditBranches actions, so I can't use the DTO (snapshot) class as the type in the view layer (razor file)
So, Tree would have a list of Branches, I have Tree as a child of AppState, which is tracked and works properly (since it's on the root). But when I get to adding Branch, this is a child of Tree, not of AppState, so my interface is
ITree {
List<IBranch> Branches
}
IBranchActions {
EditName(string)
}
IBranchSnapshot {
string Name
}
IBranch : IBranchSnapshot, IBranchActions
Now, IBranch needs to have an 'EditName' method, which is part of the Actions interface, this is what is implemented on the Proxy, not the snapshot.
Do you have any examples of this nested structure? I cannot see how to do it and have been circulating for a while now. I've looked at Todo and Flightfinder, but this does not seem to have anything like this. Is it even possible? Will it ever be? Or am I making a mistake?
I thought maybe I just put everything in the root, but you can imagine that would get very messy and tracking the IDs (or whatever) to link them back up would be a nightmare.
I'd really appreciate some advice on this. Thanks!