CSharpMigrationCodeGenerator Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Generates C# code for a code-based migration.
public class CSharpMigrationCodeGenerator : System.Data.Entity.Migrations.Design.MigrationCodeGenerator
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
public class CSharpMigrationCodeGenerator : System.Data.Entity.Migrations.Design.MigrationCodeGenerator
type CSharpMigrationCodeGenerator = class
inherit MigrationCodeGenerator
Public Class CSharpMigrationCodeGenerator
Inherits MigrationCodeGenerator
- Inheritance
- Attributes
Constructors
CSharpMigrationCodeGenerator() |
Properties
AnnotationGenerators |
Gets the AnnotationCodeGenerator instances that are being used. (Inherited from MigrationCodeGenerator) |
Methods
Generate(AddColumnOperation, IndentedTextWriter) |
Generates code to perform an AddColumnOperation. |
Generate(AddForeignKeyOperation, IndentedTextWriter) |
Generates code to perform an AddForeignKeyOperation. |
Generate(AddPrimaryKeyOperation, IndentedTextWriter) |
Generates code to perform an AddPrimaryKeyOperation. |
Generate(AlterColumnOperation, IndentedTextWriter) |
Generates code to perform an AlterColumnOperation. |
Generate(AlterProcedureOperation, IndentedTextWriter) |
Generates code to perform a AlterProcedureOperation. |
Generate(AlterTableOperation, IndentedTextWriter) |
Generates code for an AlterTableOperation. |
Generate(Byte) |
Generates code to specify the default value for a Byte column. |
Generate(Byte[]) |
Generates code to specify the default value for a byte[] column. |
Generate(ColumnModel, IndentedTextWriter, Boolean) |
Generates code to specify the definition for a ColumnModel. |
Generate(CreateIndexOperation, IndentedTextWriter) |
Generates code to perform a CreateIndexOperation. |
Generate(CreateProcedureOperation, IndentedTextWriter) |
Generates code to perform a CreateProcedureOperation. |
Generate(CreateTableOperation, IndentedTextWriter) |
Generates code to perform a CreateTableOperation. |
Generate(DateTime) |
Generates code to specify the default value for a DateTime column. |
Generate(DateTimeOffset) |
Generates code to specify the default value for a DateTimeOffset column. |
Generate(DbGeography) |
Generates code to specify the default value for a DbGeography column. |
Generate(DbGeography) |
Generates code to specify the default value for a DbGeography column. |
Generate(DbGeometry) |
Generates code to specify the default value for a DbGeometry column. |
Generate(DbGeometry) |
Generates code to specify the default value for a DbGeometry column. |
Generate(Decimal) |
Generates code to specify the default value for a Decimal column. |
Generate(DropColumnOperation, IndentedTextWriter) |
Generates code to perform a DropColumnOperation. |
Generate(DropForeignKeyOperation, IndentedTextWriter) |
Generates code to perform a DropForeignKeyOperation. |
Generate(DropIndexOperation, IndentedTextWriter) |
Generates code to perform a DropIndexOperation. |
Generate(DropPrimaryKeyOperation, IndentedTextWriter) |
Generates code to perform a DropPrimaryKeyOperation. |
Generate(DropProcedureOperation, IndentedTextWriter) |
Generates code to perform a DropProcedureOperation. |
Generate(DropTableOperation, IndentedTextWriter) |
Generates code to perform a DropTableOperation. |
Generate(Guid) |
Generates code to specify the default value for a Guid column. |
Generate(IEnumerable<MigrationOperation>, String, String) |
Generates the primary code file that the user can view and edit. |
Generate(IEnumerable<String>, IndentedTextWriter) |
Generates code to specify a set of column names using a lambda expression. |
Generate(Int64) |
Generates code to specify the default value for a Int64 column. |
Generate(MoveProcedureOperation, IndentedTextWriter) |
Generates code to perform a MoveProcedureOperation. |
Generate(MoveTableOperation, IndentedTextWriter) |
Generates code to perform a MoveTableOperation. |
Generate(Object) |
Generates code to specify the default value for a column of unknown data type. |
Generate(ParameterModel, IndentedTextWriter, Boolean) |
Generates code to specify the definition for a ParameterModel. |
Generate(RenameColumnOperation, IndentedTextWriter) |
Generates code to perform a RenameColumnOperation. |
Generate(RenameIndexOperation, IndentedTextWriter) |
Generates code to perform a RenameIndexOperation. |
Generate(RenameProcedureOperation, IndentedTextWriter) |
Generates code to perform a RenameProcedureOperation. |
Generate(RenameTableOperation, IndentedTextWriter) |
Generates code to perform a RenameTableOperation. |
Generate(Single) |
Generates code to specify the default value for a Single column. |
Generate(SqlOperation, IndentedTextWriter) |
Generates code to perform a SqlOperation. |
Generate(String, IEnumerable<MigrationOperation>, String, String, String, String) |
Generates the code that should be added to the users project. |
Generate(String, String, String, String, String) |
Generates the code behind file with migration metadata. |
Generate(String) |
Generates code to specify the default value for a String column. |
Generate(TimeSpan) |
Generates code to specify the default value for a TimeSpan column. |
GenerateAnnotation(String, Object, IndentedTextWriter) |
Generates code for the given annotation value, which may be null. The default behavior is to use an AnnotationCodeGenerator if one is registered, otherwise call ToString on the annotation value. |
GenerateAnnotations(IDictionary<String,AnnotationValues>, IndentedTextWriter) |
Generates code for to re-create the given dictionary of annotations for use when passing these annotations as a parameter of a DbMigration. call. |
GenerateAnnotations(IDictionary<String,Object>, IndentedTextWriter) |
Generates code for to re-create the given dictionary of annotations for use when passing these annotations as a parameter of a DbMigration. call. |
GenerateInline(AddForeignKeyOperation, IndentedTextWriter) |
Generates code to perform an AddForeignKeyOperation as part of a CreateTableOperation. |
GenerateInline(AddPrimaryKeyOperation, IndentedTextWriter) |
Generates code to perform an AddPrimaryKeyOperation as part of a CreateTableOperation. |
GenerateInline(CreateIndexOperation, IndentedTextWriter) |
Generates code to perform a CreateIndexOperation as part of a CreateTableOperation. |
GetDefaultNamespaces(Boolean) |
Gets the default namespaces that must be output as "using" or "Imports" directives for any code generated. (Inherited from MigrationCodeGenerator) |
GetNamespaces(IEnumerable<MigrationOperation>) |
Gets the namespaces that must be output as "using" or "Imports" directives to handle the code generated by the given operations. (Inherited from MigrationCodeGenerator) |
Quote(String) |
Quotes an identifier using appropriate escaping to allow it to be stored in a string. |
ScrubName(String) |
Removes any invalid characters from the name of an database artifact. |
TranslateColumnType(PrimitiveTypeKind) |
Gets the type name to use for a column of the given data type. |
TranslateColumnType(PrimitiveTypeKind) |
Gets the type name to use for a column of the given data type. |
WriteClassAttributes(IndentedTextWriter, Boolean) |
Generates class attributes. |
WriteClassEnd(String, IndentedTextWriter) |
Generates the closing code for a class that was started with WriteClassStart. |
WriteClassStart(String, String, IndentedTextWriter, String, Boolean, IEnumerable<String>) |
Generates a namespace, using statements and class definition. |
WriteClassStart(String, String, IndentedTextWriter, String, Boolean) |
Generates a namespace, using statements and class definition. |
WriteProperty(String, String, IndentedTextWriter) |
Generates a property to return the source or target model in the code behind file. |
Applies to
Entity Framework