Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    May 08, 2012 @ 11:13
    Anthony Candaele
    0

    problem with Razor Where clause

    Hi,

    I'm trying to filter nodes that have a property (researchFeatured) of datatype 'True/false' checked.

    my razor looks like this:

    DynamicNode featuredResearch = @Model.AncestorOrSelf().Descendants("ResearchProjectArea").Where("featuredResearch").First();

    '(featuredResearch).GetChildrenAsList threw an exception of type System.NullReferenceException'

    how can I solve this, all I want to do is get researchProject nodes that have their 'featuredResearch' property checked.

    Thanks for your help,

    Anthony

  • Anthony Candaele 1197 posts 2049 karma points
    May 08, 2012 @ 11:27
    Anthony Candaele
    0

    solved it:

    DynamicNode featuredResearch = @Model.AncestorOrSelf().Descendants("ResearchProject").Where("researchFeatured").First();

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies