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 1474 posts 3431 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 1554 posts 6205 karma points MVP 6x 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.

Please Sign in or register to post replies

Write your reply to:

Draft