是否有可能在属性基础上重载MVC View Scaffolding?

问题描述:

有没有可能是基于对财产的属性,而不是是否有可能在属性基础上重载MVC View Scaffolding?

<div class="editor-label"> 
    @Html.LabelFor(model => model.PropertyName) 
</div> 
<div class="editor-field"> 
    @Html.EditorFor(model => model.PropertyName) 
    @Html.ValidationMessageFor(model => model.PropertyName) 
</div> 

被脚手架

<div class="editor-label"> 
     @Html.LabelFor(model => model.PropertyName) 
    </div> 
    <div class="editor-field-tall"> 
     @Html.TextAreaFor(model => model.PropertyName, new { @rows = 5, @cols = 40 }) 
     @Html.ValidationMessageFor(model => model.PropertyName) 
    </div> 

没有改写以下,更换或复制到一个新的TT,然后延伸mvc脚手架模板?

无需重写,更换或 复制到一个新的TT,然后 延长MVC脚手架 模板?

如果你想编写自己的MVC脚手架模板,I would read this post which will cover how you can override the T4 templates.

+0

我曾希望避免这种情况。 – TDaver