Multiple Where clauses not same as Where with AND?

This may well be the correct and intended behaviour, but I was suprised that the following two queries didn't return the same results. Basically I was trying to work out whether any descendant nodes of a top-level page had any nodes that where both visible and with a level greater than three.

My original query was this:

bool hasMultipleLevels = topPage.Descendants().
Where("Visible && Level > 3").Count() > 0;

However, this didn't return the expected results (it would return 'true' even when the descendant pages where hidden). So I modified my query to this:

bool hasMultipleLevels = topPage.Descendants().
Where("Visible").Where("Level > 3").Count() > 0;

This worked as expected and return "false" when descendant pages where hidden.

I would have thought the two were conceptually the same? But clearly not! So is this intended or a bug? :)


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/26436-multiple-where-clauses-not-same-as-where-with-and