Copied to clipboard

Flag this post as spam?

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


  • Bart ten Velde 16 posts 233 karma points
    Jun 05, 2014 @ 16:01
    Bart ten Velde
    1

    Obsolete PersistenceManager.Default alternative ?

    Hi, we're created a PropertyDataResolverProvider for our custom propertyeditor. The contet id resolving works using PersistenceManager.Default.GetUniqueId(linkPicker.MediaId, NodeObjectTypes.Media);

    But we get an obsolete warning on PersistenceManager.Default as "please try not to use this manager...". For safety we set PersistenceManager.Default.ExecutionContext = this.ExecutionContext;

    But we like to implement our dataresolver the proper way and are looking for an alternative for the PersistenceManager to translate from nodeid to guid and back. Who can provide us a hint ?

    Bart

    ps. we implemented the dataresolver on top of UaaS version of Courier

  • Bart ten Velde 16 posts 233 karma points
    Jun 24, 2014 @ 11:14
    Bart ten Velde
    0

    bump !

  • Mark Bowser 265 posts 851 karma points c-trib
    Nov 26, 2014 @ 20:23
    Mark Bowser
    0

    I wonder about this as well. Any ideas anyone?

    Thanks

  • Paul Sterling 715 posts 1510 karma points MVP 4x admin c-trib
    Dec 02, 2014 @ 22:21
    Paul Sterling
    0

    @Mark 

    Can you simple do this as we do internally?

    DatabasePersistence = PersistenceManager.GetDefault(this);

    Or perhaps a bit of code to illustrate the issue.  Is it *just* the obsolete message?

    I think you may be using an outdated version of Courier for UaaS.  Get in touch if this is for a UaaS site and we'll get it updated for you.

    -Paul

  • Mark Bowser 265 posts 851 karma points c-trib
    Feb 17, 2015 @ 22:35
    Mark Bowser
    0

    Yes. The issue is just the obsolete warning. Things have been working fine. I just wanted to know the right way to use the PersistenceManager. I've been doing things like this:

    var nodeId = PersistenceManager.Default.GetNodeId(transferGuid, NodeObjectTypes.Document);
    

    I get little warnings that say "Umbraco.Courier.Core.PersistenceManager.Default is obsolete: Please try not to using this manager, as it does not have an execution context, unless you specify it"

    I just tried throwing in

    var defaultPersistence = PersistenceManager.GetDefault(this)
    

    but the solution won't build because PersistenceManager doesn't appear to have a GetDefault(...) method.

Please Sign in or register to post replies

Write your reply to:

Draft