Copied to clipboard

Flag this post as spam?

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


  • fabrice 104 posts 227 karma points
    Mar 10, 2011 @ 09:24
    fabrice
    0

    uQuery.GetNodesByType and umbraco.NodeFactory.Node

    Hello,

    I have a problem with uQuery.GetNodesByType :

    When I use : List<Node> listNodes = uQuery.GetNodesByType("myDocType");

    I cannot use "using umbraco.NodeFactory;" otherwize I have the error :

    "Cannot implicitly convert type 'System.Collections.Generic.List<umbraco.presentation.nodeFactory.Node>' to 'System.Collections.Generic.List<umbraco.NodeFactory.Node>'"

    And if I put "using umbraco.presentation.nodeFactory;" instead of "using umbraco.NodeFactory;" I have a warning :

    umbraco.presentation.nodeFactory.Node' is obsolete: 'This class is obsolete; use class umbraco.NodeFactory.Node instead'  

    Does anybody have the same problem ?

    How can I use uQuery.GetNodesByType with umbraco.NodeFactory.Node ?

    Thanks

     

     

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 10, 2011 @ 10:33
    Hendy Racher
    1

    Hi Fabrice,

    I'm guessing this is to do with the namespace of the Node object moving from umbraco.presentation.nodeFactory to umbraco.NodeFactory in Umbraco 4.7 - does it work when you declare the using umbraco.presentation.nodeFactory ? if so then you should be fine using it with that.

    Would be good to update uQuery so that it's compatable with all versions of Umbraco, but if this isn't possible then perhaps for the next release of uComponents it should be compiled against the umbraco.NodeFactory namespace ?

    Cheers,

    Hendy

  • fabrice 104 posts 227 karma points
    Mar 10, 2011 @ 10:41
    fabrice
    1

    That's my exactly my problem :)

    It's working fine with umbraco.presentation.nodeFactory but I'd like to use umbraco.NodeFactory as the other one is deprecated. I guess there is nothing to do for now, maybe the next version will solve the problem...

    Thanks.

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 10, 2011 @ 10:48
    Hendy Racher
    0

    Good to know it's working :)

    I heard the Node object has moved namespaces, but I don't think it's changed at all - can anyone confirm that ?

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Mar 11, 2011 @ 11:26
    Lee Kelleher
    0

    This issue applies to all packages that use the (now deprecated) nodeFactory API.  Your code will still work, the only issue is that Visual Studio will bug you about using it.

    @Hendy: The new umbraco.NodeFactory namespace does use a different object (implements the new INode interface) - as far as I'm aware, its not compatible with the (other) nodeFactory objects.

    As of uComponents v3.0, we will be compiling against the Umbraco 4.7 assemblies (this also means .NET 4.0 only too).  For the current v2.x branch, we must maintain backwards compatibility with Umbraco 4.5.x

    Cheers, Lee.

  • fabrice 104 posts 227 karma points
    Mar 11, 2011 @ 11:29
    fabrice
    0

    Great many thanks for the reply !

Please Sign in or register to post replies

Write your reply to:

Draft