One thing we have custom code to do for webforms user controls currently is to code-generate helpers from *.ascx files. I was hoping that changing the generator from MvcView to MvcHelper would allow generation of an html helper from an MvcView but
MvcHelper only works for code gen from declarative html helpers in razor. Any chance or thoughts about creating a code generator to create helpers from the views? I'd like to have both in our codebase so that if someone wants to do inheritance
or display template APIs, they can reference the precompiled view but for just in-line rendering they can use a generated helper.
e.g. we would use convention:
MyFile.cshtml, with strongly-typed model MyFileModel would result in a helper:
But you could go beyond that and allow specifying specific typed parameters with a dynamic model via a special comment block (such as):
@Html.MyFile(string firstName, int secondArg, bool thirdArg);
We're going to write a custom generator if there are no plans to do this.