Copied to clipboard

Flag this post as spam?

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


  • Arun 136 posts 369 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

Please Sign in or register to post replies

Write your reply to:

Draft