Я собрал неофициальный список свойств ASP.NET MVC 3, доступных для шаблонов T4 при использовании диалоговых окон «Добавить представление» или «Добавить контроллер» в Visual Studio 2010. Он не охватывает свойства, которые доступно при использовании MvcScaffolding в консоли диспетчера пакетов NuGet. Информация о свойствах была определена с использованием шаблона T4 для отражения над общими свойствами в MvcTextTemplateHost.
Добавить контроллер :
+--------------------+---------------+----------------------------------------------------------------------------------------+
| <b>Property Name</b> | <b>Type</b> | <b>Description</b> |
+--------------------+---------------+----------------------------------------------------------------------------------------+
| <b>AddActionMethods</b> | Boolean | Adds action methods to the generated controller class. |
| <b>AreaName</b> | System.String | The name of the Area that the controller is created for. |
| <b>ContextType</b> | System.Type | The type of the data context. |
| <b>ControllerName</b> | String | The name of the controller class that will be generated. |
| <b>ControllerRootName</b> | String | The name of the controller class excluding the Controller part at the end of the name. |
| <b>EntitySetName</b> | String | Name of the property on the data context class containing the set of entities. |
| <b>ModelType</b> | System.Type | The type of the model class specified in the Add Controller dialog. |
| <b>Namespace</b> | String | Namespace that will be used for the generated controller class. |
| <b>PrimaryKeys</b> | PrimaryKey[] | Primary keys for the model. See table at end for PrimaryKey properties. |
| <b>RelatedProperties</b> | Dictionary | Related properties on the model. See table at end for RelatedModel properties. |
+--------------------+---------------+----------------------------------------------------------------------------------------+
Добавить вид :
+-----------------------------+---------------+------------------------------------------------------------------------------------------+
| <b>Property Name</b> | <b>Type</b> | <b>Description</b> |
+-----------------------------+---------------+------------------------------------------------------------------------------------------+
| <b>AreaName</b> | System.String | The name of the Area that the view is being created for. |
| <b>ContentPlaceHolderIDs</b> | List<string> | List of content place holder IDs in the master page. |
| <b>IsContentPage</b> | Boolean | True if the generated view will be created with a master page or a Razor layout page. |
| <b>IsPartialView</b> | Boolean | True if the generated view is a partial view (e.g. an ASP.NET user control). |
| <b>MasterPageFile</b> | String | Master page file or Razor layout to be used with view (e.g. ~/Views/Shared/Site.Master). |
| <b>Namespace</b> | String | Namespace that will be used for the generated view. |
| <b>PrimaryContentPlaceHolderID</b> | String | Primary content place holder ID to be used when creating a view using a master page. |
| <b>ReferenceScriptLibraries</b> | Boolean | True if checked in the Add View dialog. |
| <b>ViewDataType</b> | System.Type | The view model's type. |
| <b>ViewDataTypeName</b> | String | Fully qualified name for the view model's type. |
| <b>ViewName</b> | String | Name of the view. |
+-----------------------------+---------------+------------------------------------------------------------------------------------------+
Общие свойства :
+---------------------+-------------------------+-----------------------------------------------------------------------------------------------+
| <b>Property Name</b> | <b>Type</b> | <b>Description</b> |
+---------------------+-------------------------+-----------------------------------------------------------------------------------------------+
| <b>AssemblyPath</b> | List<string> | List of assemblies referenced by the project and the project's output assembly. Internal use. |
| <b>Errors</b> | CompilerErrorCollection | Used to stored errors that occur whilst processing the T4 template. Internal use. |
| <b>FileEncoding</b> | System.Text.Encoding | The encoding of the file that will be generated. |
| <b>FileExtension</b> | String | Not set. |
| <b>FrameworkVersion</b> | System.Version | The .NET framework version. |
| <b>OutputFileExtension</b> | System.String | The extension of the file that will be generated. |
| <b>TemplateFile</b> | System.String | The full path to the T4 template file being used. |
+---------------------+-------------------------+-----------------------------------------------------------------------------------------------+