Copied to clipboard
  • Jacob Polden 172 karma points
    Mar 09, 2012 @ 17:27
    Jacob Polden
    0

    Problem with Razor collections

    I'm just trying to replicate warren's RSS Razor script with a few modifications.  Something strikes me as strange.

    Should it be possible for a node to have more children than descendents. e.g. I just tried...

     <p>@Model.AncestorOrSelf(1).Decendents.Count()</p>
     <p>@Model.AncestorOrSelf(1).Children.Count()</p>

    I got the following:

    0

    13

    But I thought that the set of all descendents of a node was a superset of the set of all children, so the number of decendents should always be equal to or greater than the number of children.

  • Dirk De Grave5195 karma points admin
    Mar 09, 2012 @ 17:57
    Dirk De Grave
    0

    I really hope it's just not a spelling mistake Decendents()  vs Descendants()

     

    Cheers,

    /Dirk

  • Jacob Polden172 karma points
    Mar 09, 2012 @ 18:05
    Jacob Polden
    0

    The level of embarssement I feel right now...

Please Sign in or register to post replies

Write your reply to:

Draft
Our.umbraco.org is the community mothership for Umbraco, the open source asp.net cms. With a friendly forum for all your questions, a comprehensive documentation and a ton of packages from the community.