Copied to clipboard

Flag this post as spam?

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


  • Mahender Singh 39 posts 171 karma points
    Oct 17, 2022 @ 18:41
    Mahender Singh
    1

    How to Get Published Content in RecurringHostedServiceBase?

    Hello Everyone,

    I am new for Umbraco and try to create a schedule job that will take all published content from umbraco database culture wise and do some some processing.

    Can anyone please help me in this.

    Using UmbracoContextReference I am able to get content by id but not all childrens culture wise.

    UmbracoContextReference umbracoContextReference = _contextFactory.EnsureUmbracoContext()
     IPublishedContentCache contentCache = umbracoContextReference.UmbracoContext.Content;
    
                            IPublishedContent publishedContent = contentCache.GetById(new Guid(_configuration.GetValue<string>("Application:ProductMasterID")));
    
                            var allProducts = publishedContent.Children.Select(x =>  new ProductDetail(x, _publishedValueFallback)).ToList();
    
  • anh-duc-le 38 posts 152 karma points
    Jun 04, 2024 @ 20:13
    anh-duc-le
    0

    Did you ever find an answer to this issue?

  • 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