CodeGenerator Class

An abstract class representing a code generator. For more details ICodeGenerator interface.

System.Object
  Microsoft.AspNet.Scaffolding.CodeGenerator

Namespace:  Microsoft.AspNet.Scaffolding
Assembly:  Microsoft.AspNet.Scaffolding.12.0 (in Microsoft.AspNet.Scaffolding.12.0.dll)

public abstract class CodeGenerator : ICodeGenerator

The CodeGenerator type exposes the following members.

  NameDescription
Protected methodCodeGeneratorConstructor.
Top

  NameDescription
Public propertyContextGets the CodeGenerationContext for the current code generation operation.
Public propertyDependenciesA list of NuGet packages upon which this code generator depends in order to run successfully. Packages listed here will be installed after ShowUIAndValidate succeeded and before the GenerateCode method is invoked.
Public propertyInformationGets the CodeGeneratorInformation for the current code generation operation.
Public propertyServiceProviderGets the IServiceProvider for the current code generation operation.
Public propertyTemplateFoldersList of search paths of this code generator where templates/static files are searched for. By default, this list contains only one folder which is a sub-directory named "Templates\ Id inside the directory containing the CodeGenerator assembly. Custom code generators can override the default behavior.
Top

  NameDescription
Protected methodAddClassMemberFromTemplateAdds the result of running a Visual Studio T4 text template to an existing source file as a class member at the end.
Protected methodAddFileAdds a new file to the active project at the given relative path.
Protected methodAddFileFromTemplateExecutes a template and adds the generated code as a project file.
Protected methodAddFolderAdds a new folder to the active project at the given relative path. If a project item already exists for the active project at the given projectRelativePath, nothing is done. If there is already a folder on the disk but that is not part of the project, the folder is added to the project.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGenerateCodePerforms code generation.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodShowUIAndValidateGathers and validates information necessary for code generation. Any UI for the code generator should be displayed in this method.
Public methodToString (Inherited from Object.)
Top

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: