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
in Umbraco 8 I want to move a node to a parent folder by it's parent folder key (Guid)
Can I do something like this:
_contentService.Move(orderNode, new Guid(archiveParentId));
It says it needs the integer Id but thought we were moving away from them?
It looks like the ContentService doesn't have a signature for move that takes the parent GUID 'yet'
(you can see 'Create' has been updated in this file to have both int Id, and Guid signatures).
The 'GetById' method has both signatures:
So if you ONLY have access to the parent GUID in your custom method, you could first retrieve the parent as an IContent item and pass the integer Id into the move signature.
IContent archiveParent = _ContentService.GetById(archiveParentGuid);
but, as the Move method will then retrieve the IContent object again for the Parent by it's integer Id, it would be much better to have signatures taking in the Guid and/or an IContent item for the Parent when performing this Move...
Thats what I went with for now.
I guess I could add this as an application variable as the parent folders should not be deleted.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted