【发布时间】:2013-07-05 19:46:21
【问题描述】:
我正在开发一个 T4 模板,该模板将基于核心上的实体生成视图模型。 例如,我在 Core 中有 News 类,我希望这个模板生成这样的视图模型
public class News
{
public property int Id {get;set;}
public property string Title {get;set;}
public property string Content {get;set;}
}
public class NewsCreate
{
public property int Id {get;set;}
public property string Title {get;set;}
public property string Content {get;set;}
}
public class NewsUpdate
{
public property int Id {get;set;}
public property string Title {get;set;}
public property string Content {get;set;}
}
现在只有这两个。但我找不到获取 News 类属性的方法。 我如何使用反射来获取它们和 . . .
【问题讨论】:
标签: c# asp.net-mvc asp.net-mvc-4 t4 scaffolding