Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm having difficulty with the new umbraco.NodeFactory.Node class.
Previously (using umbraco.presentation.nodeFactory), I was able to get the parent node like this:
Node n = new Node(1234);Node p = n.Parent;
Doing that in ver 4.6.1 (using umbraco.NodeFactory.Node) gives me this error:
"Cannot implicitly convert type 'umbraco.interfaces.INode' to 'umbraco.NodeFactory.Node'."
I could go back to using umbraco.presentation.nodeFactory.Node - but I try to avoid using depricated classes.
Any help is appreciated.
Not sure why it returns INode instead of Node, but as a workaround I've used
Node n = new Node(1234);Node p = new Node(n.Parent.Id);
That sould work. Thanks for the help.
I use an extension method:
public static Node ParentNode(this Node node)
return new Node(node.Parent.Id);
but getting a simple parent node shouldn't be this difficult.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted