x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

  • Avatar50posts110karma

    Problem with Razor collections

    Jacob Polden started this topic March 9, 2012 @ 05:27, Go directly to the topic solution

    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 Grave posted this reply March 9, 2012 @ 05:57

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

     

    Cheers,

    /Dirk


  • Avatar50posts110karma
    Comment with ID: 110452
    Jacob Polden posted this reply March 9, 2012 @ 06:05

    The level of embarssement I feel right now...


Please login or Sign up To post replies