命名 ASP.NET MVC 中存在的 3 种不同类型模型的约定是什么? ( Controller 输入、 Controller 输出和持久性)
Visual Studio 在 MVC 3 脚手架中为每个模型类添加了“模型”后缀,但我不确定这是不区分模型类型的好方法。
我想问的一个次要问题是如何命名这 3 种不同类型的模型。我不是进入 View 的模型称为 View 模型。持久化可以称为持久化模型。但是 Controller 输入模型呢?
最佳答案
我通常使用 *ViewModel
作为 Controller 输出模型,使用 *Form
作为 Controller 输入模型。
对于持久性(域模型/实体),我不使用任何特殊的命名约定。
关于asp.net-mvc - 命名 ASP.NET MVC 中存在的 3 种不同类型模型的约定是什么? ( Controller 输入、 Controller 输出和持久性),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6968823/