Copied to clipboard

Flag this post as spam?

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


  • wmotr 16 posts 146 karma points
    Sep 06, 2021 @ 15:59
    wmotr
    0

    System.ObjectDisposedException / "Snapshot " / TagQuery

    Hi friends from the internet,

    I have created an ArticleService used from 1/ a public API Controller (using Umbraco as a Headless CMS) 2/ a Controller using route highjacking, to show Articles List on a umbraco Hosted site.

    I followed this example : https://our.umbraco.com/documentation/reference/cache/examples/tags

    the only thing is that the API can Query using different tags, and we have plenty of different tags (approx 40).

    So : 1/ ArticleApiController uses ArticleService enter image description here to do a GetArticlesByTag : enter image description here

    2/ which uses Article Service and TagService : enter image description here enter image description here enter image description here

    3/ everything is registered using DI :

    enter image description here

    Unfortunately, after 1 request, I got an error, if I change the Tags Requested :

    searched = _tagQuery.GetContentByTag(tag).ToList();

    enter image description here Sorry it's in french : Impossible to access a disposed object : snapshot

    Any Idea ?

  • wmotr 16 posts 146 karma points
    Sep 09, 2021 @ 22:13
    wmotr
    0

    I finally recreated a function looping through Articles with a Contains() method overs the tags. of course it's being cached. But if someone has a clue ...

  • 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