I've been using the spark view engine bindings and I have a problem with it not correctly recognizing overloads.
I have 2 overloads that look like this:
<element name="Editor">Html.EditorFor(x => x.@For, new {"@*"}) </element>
<element name="Editor">Html.EditorFor(x => x.@For)</element>
Now, the documentation says that for an overload to work I need to put the most specific bindings first.
The problem is if I try and use the Editor like this
It incorrectly passes through a blank parameter to the first element overload and resolves to:
Output.Write("${Html.EditorFor(x => x.Username, new {}) }");
Which is obviously going to throw an error as there's an empty object initializer even though there isn't any additional attributes to be passed through on the Html element defined in the view.
Is this just a case that the spark bindings can't handle for now and is it something I'm going to have to write specific element bindings for, rather than use overloads?
The problem here is different, but the answer is actually the same as the answer @RobTheGrey provided in his answer to this question: Spark View Engine Bindings with Class Html Attribute
Basically it comes down to using the correct syntax of
<element name="Editor">Html.EditorFor(x => x.@For, new Dictionary[[string,object]]{{"@*"}}) </element>