Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arun 144 posts 407 karma points
    Feb 01, 2022 @ 12:30
    Arun
    0

    Refresh Content in Umbraco 8 Programatically

    Hi All
    I've created a node programatically in my Service class.

    _contentService.SaveAndPublish(content, raiseEvents: false);

    Just after this I would like to access the node as IPublishedContent
    I tried

    IPublishedContent test = _helper.Content(content.Id);

    but getting null.!
    May be i need to refresh cache before accessing the node with UmbracoHelper, hence i tried

    umbraco.library.RefreshContent();
    Which is no longer supported
    Any help is appreciated.

    Thanks

  • 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.

Please Sign in or register to post replies