Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Jul 15, 2011 @ 02:53
    Tom
    0

    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"?


  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 15, 2011 @ 08:42
    Sebastiaan Janssen
    1

    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>
    }
    }
  • Tom 713 posts 954 karma points
    Jul 15, 2011 @ 08:51
    Tom
    0

    Alas it's not ideal but oh well! thank you for all your replies Sebastiaan!

  • Tom 713 posts 954 karma points
    Jul 15, 2011 @ 09:28
    Tom
    0

    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

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 15, 2011 @ 09:36
    Sebastiaan Janssen
    0

    Not sure, I'll ask Gareth to have a look at it, he might've already made something nice for this.

  • Tom 713 posts 954 karma points
    Jul 18, 2011 @ 00:56
    Tom
    0

    Thanks Sebastiaan,

    most appreciated!

  • Gareth Evans 142 posts 334 karma points c-trib
    Jul 22, 2011 @ 05:57
    Gareth Evans
    1

    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.

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 22, 2011 @ 15:25
    Sebastiaan Janssen
    0

    The longhand doesn't do anything differently does it, give me the same error as the original problem..

  • Tom 713 posts 954 karma points
    Jul 25, 2011 @ 00:40
    Tom
    0

    Yes the longhand doesn't evaluate correctly.. currently you can use the shorthand || it just blows up..

     

  • Gareth Evans 142 posts 334 karma points c-trib
    Jul 25, 2011 @ 03:47
    Gareth Evans
    0

    Could you guys please test this build?

    http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine.zip

    (Just updated 5 min ago)

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 25, 2011 @ 11:50
    Sebastiaan Janssen
    0

    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\"");
    }
  • Gareth Evans 142 posts 334 karma points c-trib
    Jul 27, 2011 @ 04:12
    Gareth Evans
    1

    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

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Jul 27, 2011 @ 10:05
    Sebastiaan Janssen
    0

    That's it, works like a charm now!

Please Sign in or register to post replies

Write your reply to:

Draft