Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1431 posts 3332 karma points c-trib
    Oct 17, 2011 @ 10:09
    Simon Dingley
    0

    Where with multiple conditions

    Hit another stumbling block with my limited Razor fu! I have multiple where conditions I would like to check for as follows:

    parent.Children.Where("Visible && !noMenuNodes.Contains(NodeTypeAlias as string) && HasAccess");

    The entire script fails on this so any advice on how to achieve the correct result would be appreciated.

    TIA, Simon

  • Dan Diplo 1505 posts 5911 karma points MVP 4x c-trib
    Oct 17, 2011 @ 10:14
    Dan Diplo
    1

    Your basic principle looks sounds by ANDing together your boolean conditions. If it doesn't work then likely one of the conditions cannot be evaluated, and the obvious candidate would be "!noMenuNodes.Contains(NodeTypeAlias as string)". If I where you I'd try each condition individually to see if it works in isolation. That way you should be able to pinpoint which is failing.

  • 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