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
@{
var allCollectionItems = Model.Descendants().Where("nodeTypeAlias.Equals(\"externalCollection\") || nodeTypeAlias.Equals(\"individualCollection\")");
}
I'm getting "Incorrect number of parameters supplied for lambda declaration"?
Looks like you can only do single expressions, I've used something like this before:
@foreach(var item in Model.AncestorOrSelf(1).Descendants()) {if(item.NodeTypeAlias == "Person" || item.NodeTypeAlias == "TextPage") {<text>@item.Name</text>}}
Alas it's not ideal but oh well! thank you for all your replies Sebastiaan!
Hi Sebastiaan,
just wondering if this was a bug? permanent? by design? is it a feature that will be introduced in later versions?
Thanks.
Tom
Not sure, I'll ask Gareth to have a look at it, he might've already made something nice for this.
Thanks Sebastiaan,
most appreciated!
Use a longhand .Where("NodeTypeAlias == \"value\" || NodeTypeAlias == \"othervalue\"") for the time being.
I've fixed ContainsAny for 4.7.1 for this, and in 4.7.2 I've got a plan to make it even better.
The longhand doesn't do anything differently does it, give me the same error as the original problem..
Yes the longhand doesn't evaluate correctly.. currently you can use the shorthand || it just blows up..
Could you guys please test this build?
http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine.zip
(Just updated 5 min ago)
Only updated umbraco.MacroEngines.dll from that zip and this gives me "Incorrect number of parameters supplied for lambda declaration":
@{ var someOverview = Model.AncestorOrSelf(1).Children.Where("nodeTypeAlias == \"BlogOverview\" || nodeTypeAlias == \"PortfolioOverview\"");}
Okay, I've investigated that expression, tested and merged another change to fix it.
Here is the full bin folder, I use this to "half upgrade" a 4.7.0 to run the latest macro engine (there was a datatype lookup change bug fix which is not in macroengines): http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine-All.zip
Here is just the macroengine assembly (&pdb): http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine-Only.zip
That's it, works like a charm now!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Incorrect Number of Parameters Supplied for Lambda Expression
@{
var allCollectionItems = Model.Descendants().Where("nodeTypeAlias.Equals(\"externalCollection\") || nodeTypeAlias.Equals(\"individualCollection\")");
}
I'm getting "Incorrect number of parameters supplied for lambda declaration"?
Looks like you can only do single expressions, I've used something like this before:
Alas it's not ideal but oh well! thank you for all your replies Sebastiaan!
Hi Sebastiaan,
just wondering if this was a bug? permanent? by design? is it a feature that will be introduced in later versions?
Thanks.
Tom
Not sure, I'll ask Gareth to have a look at it, he might've already made something nice for this.
Thanks Sebastiaan,
most appreciated!
Use a longhand .Where("NodeTypeAlias == \"value\" || NodeTypeAlias == \"othervalue\"") for the time being.
I've fixed ContainsAny for 4.7.1 for this, and in 4.7.2 I've got a plan to make it even better.
The longhand doesn't do anything differently does it, give me the same error as the original problem..
Yes the longhand doesn't evaluate correctly.. currently you can use the shorthand || it just blows up..
Could you guys please test this build?
http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine.zip
(Just updated 5 min ago)
Only updated umbraco.MacroEngines.dll from that zip and this gives me "Incorrect number of parameters supplied for lambda declaration":
Okay, I've investigated that expression, tested and merged another change to fix it.
Here is the full bin folder, I use this to "half upgrade" a 4.7.0 to run the latest macro engine (there was a datatype lookup change bug fix which is not in macroengines): http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine-All.zip
Here is just the macroengine assembly (&pdb): http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine-Only.zip
That's it, works like a charm now!
is working on a reply...