Say I have the following models:
public class Item
{
public int Id{ get; set; }
public ItemDescription ItemDescription{ get; set; }
}
public class ItemDescription
{
public int Id{ get; set; }
public int Revision{ get; set; }
public string Test{ get; set; }
}
I run the following in the package-manager:
Scaffold Controller Item
to generate some views and stuff... but it appears that the scaffolder ignores any complex/non-scalar data types and consequently generates views that are of little use.
I am wondering if it is possible to instruct the scaffolder to be a little more intelligent about things. Here's what I would like to happen:
- scaffolder creates Editor/Display templates in the shared folder
- uses
EditorFor
to leverage these templates
All the code to make this happen seems to be generated by the scaffolder, but is structured in a way that surprises me, with _CreateOrEdit.cshtml
"templates" generated in the folder associated with the view. To me, this suggests that the scaffolder generates code that would not be ideally suited to a more recursive way of generating views for models.
Are my expectations way off, or am I missing something?