Scaffolding and Display / EditorTemplates

Let's 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 package manager:

Scaffold Controller Item

to generate some views and stuff ... but it seems that the scaffolder ignores any complex / non-scalar data types and therefore generates little-used views.

I am wondering if it is possible to teach a scaffolder to be a little smarter about things. Here is what I would like to do:

  • scaffolder creates editor / display templates in a shared folder
  • uses EditorForto use these patterns

, , , scaffolder, , , _CreateOrEdit.cshtml "", , . , scaffolder , .

- ?

+5
1

T4, Visual Studio

YourPathToVisualStudio2010\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates

, . , , - /.

- T4 ( ). - Visual Studio Secret.

" ".

!

Update

( mvc) - Microsoft ( , scott hanselman ;)) codeplex ASP.NET Webstack. !

MVC4 RTM, , , .

Visual Studio (MVC4)

Recipes Visual Studio , NuGet. Recipes , Add Area, Add Controller Add View. NuGet, . .

. , .

+4

All Articles