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
    Sep 08, 2022 @ 14:58
    Mahender Singh
    0

    Convert IContent to PublishedContent

    Hi Team,

    Is there any way, through which I can create class library project and convert IContent into PublishedContent or custom entity class.

    Actually IUmbracoContextAccessor is making my Umbraco api bit slower.

     public static IPublishedContent GetUmbracoObject(IUmbracoContextAccessor _context, Guid id)
            {
    
                var cache = _context.GetRequiredUmbracoContext();
                return cache.Content.GetById(id);
            }
    
Please Sign in or register to post replies

Write your reply to:

Draft