Copied to clipboard

Flag this post as spam?

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


  • npack 56 posts 322 karma points
    12 hours ago
    npack
    0

    v15 - Finding Content - A little lost in the maze

    (IUmbracoContext, UmbracoHelper, IDocumentNavigationQueryService, IDocumentCacheService, async)

    I've got a variety of content finders and custom controllers that access the content tree. I had been using UmbracoHelper and IUmbracoContextAccessor for most of my needs but in v15 several methods seem to be deprecated.

    I have a few questions.

    1) Is there somewhere where changes like this are explained and best practices defined? I see new references to a IDocumentNavigationQueryService but am I supposed to start using that everywhere instead? What is the roadmap?

    2) This IDocumentNavigationQueryService returns keys, but most of my code needs the content node itself. Should I also be injecting an IDocumentCacheService and then calling GetByKeyAsync? If so, the async in the name makes me worry that I'm hitting the DB now where perhaps I wasn't before. The async also makes it difficult to call from inside a content finder's FindContent method which isn't async.

    3) UmbracoContext.Content.GetByRoute() is marked as obsolete now. What is the suggested alternative?

Please Sign in or register to post replies

Write your reply to:

Draft