Copied to clipboard

Flag this post as spam?

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


  • Anders Schmidt 76 posts 207 karma points
    Apr 25, 2014 @ 09:24
    Anders Schmidt
    0

    Get first child node with document type.

    I need to find first child of dynamic node with a specific document type alias.

    -parent 

    -child (document type: do not find me)

    -child (document type: Findme)

     

    I have a lot....Among:

        DynamicNode d = new DynamicNode(Convert.ToInt32(node.Id));
    
        var test1 = d.Children.Where(x => x.DocumentTypeAlias == "Findme").FirstOrDefault();
        //var test2 = d.Children.FirstOrDefault();

    test1 failes on x.DocumentTypeAlias

    test2 is okay

    I am using Umbraco7.1

     

    Thanks

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 25, 2014 @ 09:39
    Dennis Aaen
    101

    Hi Anders,

    How about something like this:

    DynamicNode d = newDynamicNode(Convert.ToInt32(node.Id));

    var test1 = d.Children.Where(x => x.NodeTypeAlias == "findme").FirstOrDefault();

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft