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 not sure if I just missed it, but I can't seem to find a way to publish my Icontent from C#.
I tried following this doc, but publish and SaveAndPublishWithStatus are missing.
publish
SaveAndPublishWithStatus
Current I've managed to save the Content with contentService.Save(child); but how can I publish it?
contentService.Save(child);
If you are in one of the Umbraco controllers (Surface, Mvc or Api controller) you should be able to do this:
var node = Services.ContentService.Create("name", parentId, contentTypeAlias); node.SetValue("myProperty", "someValue"); Services.ContentService.SaveAndPublish(node);
The docs you are checking are from V7 anyways.
Thanks for your answer Mario,
I'm not using this in a controller, but together with Hangfire to run some scheduled tasks.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Publish Icontent
I'm not sure if I just missed it, but I can't seem to find a way to publish my Icontent from C#.
I tried following this doc, but
publish
andSaveAndPublishWithStatus
are missing.Current I've managed to save the Content with
contentService.Save(child);
but how can I publish it?If you are in one of the Umbraco controllers (Surface, Mvc or Api controller) you should be able to do this:
The docs you are checking are from V7 anyways.
Thanks for your answer Mario,
I'm not using this in a controller, but together with Hangfire to run some scheduled tasks.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.