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 170 karma points
    Oct 17, 2022 @ 18:41
    Mahender Singh
    0

    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();
    
Please Sign in or register to post replies

Write your reply to:

Draft