Copied to clipboard

Flag this post as spam?

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


  • Dipa 88 posts 370 karma points
    Jun 29, 2016 @ 10:59
    Dipa
    0

    Get all node's list without specifying Id or DocType

    Hello All,

    In my content node, I have many nodes. Now I want all node's list using c# programing. Without specifying any Id or DocType name or anything else.

    I want list of all any. Is this possible? if yes then let me know how it can be possible?

    Thanks, Dipa

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Jun 29, 2016 @ 11:04
    Michaël Vanbrabandt
    0

    Hi Dipa,

    take a look at the ContentService that you can use to get the content nodes.

    /Michaël

  • Dennis Adolfi 1082 posts 6446 karma points MVP 5x c-trib
    Jun 29, 2016 @ 12:43
    Dennis Adolfi
    0

    Hi Dipa!

    Using the UmbracoHelper you can get all nodes using the following:

    var allNodes = Umbraco.TypedContentAtRoot().SelectMany(x => x.DescendantsOrSelf());
    

    See output example (Note that this query does not fetch unpublished nodes):

    enter image description here

    Hope it helped!

Please Sign in or register to post replies

Write your reply to:

Draft