Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'm using a Razor where statement to get a list of childnodes:
subcategoryItems = @Model.AncestorOrSelf("SolutionArea").Children.Where("solutionSubcategories == \"" + subcategory + "\"");
However, when I add a AND (&&) condition to the WHERE clause I get an error:
subcategoryItems = @Model.AncestorOrSelf("SolutionArea").Children.Where("solutionCategory == \"" + category + "\"" && "solutionSubcategories == \"" + subcategory + "\"");
Is there a syntax error in this statement??
thanks for your help,
Anthony
Hi Anthony
What does the error message say?
/Jan
Hi Jan,
Can't say, the debugger won't step in the process. Maybe it's a syntax error.
greetings,
found the issue, this where clause works:
subcategoryItems = Model.AncestorOrSelf("SolutionArea").Children
.Where("solutionSubcategories == \"" + subcategory + "\" && solutionCategory==\""+ category + "\"");
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
problem with where clause
Hi,
I'm using a Razor where statement to get a list of childnodes:
subcategoryItems = @Model.AncestorOrSelf("SolutionArea").Children.Where("solutionSubcategories == \"" + subcategory + "\"");
However, when I add a AND (&&) condition to the WHERE clause I get an error:
subcategoryItems = @Model.AncestorOrSelf("SolutionArea").Children.Where("solutionCategory == \"" + category + "\"" && "solutionSubcategories == \"" + subcategory + "\"");
Is there a syntax error in this statement??
thanks for your help,
Anthony
Hi Anthony
What does the error message say?
/Jan
Hi Jan,
Can't say, the debugger won't step in the process. Maybe it's a syntax error.
greetings,
Anthony
found the issue, this where clause works:
subcategoryItems = Model.AncestorOrSelf("SolutionArea").Children
.Where("solutionSubcategories == \"" + subcategory + "\" && solutionCategory==\""+ category + "\"");
is working on a reply...