Copied to clipboard

Flag this post as spam?

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


  • john blair 48 posts 219 karma points
    Sep 09, 2019 @ 15:04
    john blair
    1

    Howto access UmbracoContext in PropertyValueConverter

    How do i access UmbracoContext in a property value converter?

    If I inject IUmbracoContextFactory I get an umbraco boot loader failure as it cannot find that type.

    Why is there no Current.UmbracoContext?

    I am actually trying to access a published content node ..is there a recommended way of doing this?

    public class TaxonomyPropertyValueConverter : PropertyValueConverterBase

  • john blair 48 posts 219 karma points
    Sep 09, 2019 @ 15:49
    john blair
    100

    Reflected on the MultiUrlPicker and copied it. Now injecting IPublishedSnapshotAccessor publishedSnapshotAccessor

    and accessing IPublishedContent off of it.

    No idea why this is injectable here while IUmbracoContextFactory is not. But IUmbracoContextFactory is injectable for a component implementing IComponent .... thought the whole point of the injection system was you could get a registered type whenever you wanted it not just at random.

Please Sign in or register to post replies

Write your reply to:

Draft