VisualBasicMigrationCodeGenerator.Generate Method
Generates the primary code file that the user can view and edit.
Assembly: EntityFramework (in EntityFramework.dll)
VisualBasicMigrationCodeGenerator.Generate Method (AddColumnOperation, IndentedTextWriter)
Generates code to perform an AddColumnOperation.
protected virtual void Generate( AddColumnOperation addColumnOperation, IndentedTextWriter writer )
Parameters
- addColumnOperation
-
Type:
System.Data.Entity.Migrations.Model.AddColumnOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (AddForeignKeyOperation, IndentedTextWriter)
Generates code to perform an AddForeignKeyOperation.
protected virtual void Generate( AddForeignKeyOperation addForeignKeyOperation, IndentedTextWriter writer )
Parameters
- addForeignKeyOperation
-
Type:
System.Data.Entity.Migrations.Model.AddForeignKeyOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (AddPrimaryKeyOperation, IndentedTextWriter)
Generates code to perform an AddPrimaryKeyOperation.
protected virtual void Generate( AddPrimaryKeyOperation addPrimaryKeyOperation, IndentedTextWriter writer )
Parameters
- addPrimaryKeyOperation
-
Type:
System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (AlterColumnOperation, IndentedTextWriter)
Generates code to perform an AlterColumnOperation.
protected virtual void Generate( AlterColumnOperation alterColumnOperation, IndentedTextWriter writer )
Parameters
- alterColumnOperation
-
Type:
System.Data.Entity.Migrations.Model.AlterColumnOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (AlterProcedureOperation, IndentedTextWriter)
Generates code to perform a AlterProcedureOperation.
protected virtual void Generate( AlterProcedureOperation alterProcedureOperation, IndentedTextWriter writer )
Parameters
- alterProcedureOperation
-
Type:
System.Data.Entity.Migrations.Model.AlterProcedureOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (AlterTableOperation, IndentedTextWriter)
Generates code for an AlterTableOperation.
protected internal virtual void Generate( AlterTableOperation alterTableOperation, IndentedTextWriter writer )
Parameters
- alterTableOperation
-
Type:
System.Data.Entity.Migrations.Model.AlterTableOperation
The operation for which code should be generated.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
The writer to which generated code should be written.
VisualBasicMigrationCodeGenerator.Generate Method (Byte[])
Generates code to specify the default value for a T:byte[] column.
Parameters
- defaultValue
-
Type:
System.Byte[]
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (ColumnModel, IndentedTextWriter, Boolean)
Generates code to specify the definition for a ColumnModel.
[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] [SuppressMessageAttribute("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] protected virtual void Generate( ColumnModel column, IndentedTextWriter writer, bool emitName = false )
Parameters
- column
-
Type:
System.Data.Entity.Migrations.Model.ColumnModel
The column definition to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
- emitName
-
Type:
System.Boolean
A value indicating whether to include the column name in the definition.
VisualBasicMigrationCodeGenerator.Generate Method (CreateIndexOperation, IndentedTextWriter)
Generates code to perform a CreateIndexOperation.
protected virtual void Generate( CreateIndexOperation createIndexOperation, IndentedTextWriter writer )
Parameters
- createIndexOperation
-
Type:
System.Data.Entity.Migrations.Model.CreateIndexOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (CreateProcedureOperation, IndentedTextWriter)
Generates code to perform a CreateProcedureOperation.
protected virtual void Generate( CreateProcedureOperation createProcedureOperation, IndentedTextWriter writer )
Parameters
- createProcedureOperation
-
Type:
System.Data.Entity.Migrations.Model.CreateProcedureOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (CreateTableOperation, IndentedTextWriter)
Generates code to perform a CreateTableOperation.
protected virtual void Generate( CreateTableOperation createTableOperation, IndentedTextWriter writer )
Parameters
- createTableOperation
-
Type:
System.Data.Entity.Migrations.Model.CreateTableOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (DateTime)
Generates code to specify the default value for a DateTime column.
Parameters
- defaultValue
-
Type:
System.DateTime
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (DateTimeOffset)
Generates code to specify the default value for a DateTimeOffset column.
Parameters
- defaultValue
-
Type:
System.DateTimeOffset
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (DbGeography)
Generates code to specify the default value for a DbGeography column.
Parameters
- defaultValue
-
Type:
System.Data.Entity.Spatial.DbGeography
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (DbGeometry)
Generates code to specify the default value for a DbGeometry column.
Parameters
- defaultValue
-
Type:
System.Data.Entity.Spatial.DbGeometry
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (Decimal)
Generates code to specify the default value for a Decimal column.
Parameters
- defaultValue
-
Type:
System.Decimal
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (DropColumnOperation, IndentedTextWriter)
Generates code to perform a DropColumnOperation.
protected virtual void Generate( DropColumnOperation dropColumnOperation, IndentedTextWriter writer )
Parameters
- dropColumnOperation
-
Type:
System.Data.Entity.Migrations.Model.DropColumnOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (DropForeignKeyOperation, IndentedTextWriter)
Generates code to perform a DropForeignKeyOperation.
protected virtual void Generate( DropForeignKeyOperation dropForeignKeyOperation, IndentedTextWriter writer )
Parameters
- dropForeignKeyOperation
-
Type:
System.Data.Entity.Migrations.Model.DropForeignKeyOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (DropIndexOperation, IndentedTextWriter)
Generates code to perform a DropIndexOperation.
protected virtual void Generate( DropIndexOperation dropIndexOperation, IndentedTextWriter writer )
Parameters
- dropIndexOperation
-
Type:
System.Data.Entity.Migrations.Model.DropIndexOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (DropPrimaryKeyOperation, IndentedTextWriter)
Generates code to perform a DropPrimaryKeyOperation.
protected virtual void Generate( DropPrimaryKeyOperation dropPrimaryKeyOperation, IndentedTextWriter writer )
Parameters
- dropPrimaryKeyOperation
-
Type:
System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (DropProcedureOperation, IndentedTextWriter)
Generates code to perform a DropProcedureOperation.
protected virtual void Generate( DropProcedureOperation dropProcedureOperation, IndentedTextWriter writer )
Parameters
- dropProcedureOperation
-
Type:
System.Data.Entity.Migrations.Model.DropProcedureOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (DropTableOperation, IndentedTextWriter)
Generates code to perform a DropTableOperation.
protected virtual void Generate( DropTableOperation dropTableOperation, IndentedTextWriter writer )
Parameters
- dropTableOperation
-
Type:
System.Data.Entity.Migrations.Model.DropTableOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (Guid)
Generates code to specify the default value for a Guid column.
Parameters
- defaultValue
-
Type:
System.Guid
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (IEnumerable<MigrationOperation>, String, String)
Generates the primary code file that the user can view and edit.
[SuppressMessageAttribute("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "namespace")] [SuppressMessageAttribute("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")] protected virtual string Generate( IEnumerable<MigrationOperation> operations, string namespace, string className )
Parameters
- operations
-
Type:
System.Collections.Generic.IEnumerable<MigrationOperation>
Operations to be performed by the migration.
- namespace
-
Type:
System.String
Namespace that code should be generated in.
- className
-
Type:
System.String
Name of the class that should be generated.
VisualBasicMigrationCodeGenerator.Generate Method (IEnumerable<String>, IndentedTextWriter)
Generates code to specify a set of column names using a lambda expression.
Parameters
- columns
-
Type:
System.Collections.Generic.IEnumerable<String>
The columns to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (Int64)
Generates code to specify the default value for a Int64 column.
Parameters
- defaultValue
-
Type:
System.Int64
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (MoveProcedureOperation, IndentedTextWriter)
Generates code to perform a MoveProcedureOperation.
protected virtual void Generate( MoveProcedureOperation moveProcedureOperation, IndentedTextWriter writer )
Parameters
- moveProcedureOperation
-
Type:
System.Data.Entity.Migrations.Model.MoveProcedureOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (MoveTableOperation, IndentedTextWriter)
Generates code to perform a MoveTableOperation.
protected virtual void Generate( MoveTableOperation moveTableOperation, IndentedTextWriter writer )
Parameters
- moveTableOperation
-
Type:
System.Data.Entity.Migrations.Model.MoveTableOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (Object)
Generates code to specify the default value for a column of unknown data type.
[SuppressMessageAttribute("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] protected virtual string Generate( object defaultValue )
Parameters
- defaultValue
-
Type:
System.Object
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (ParameterModel, IndentedTextWriter, Boolean)
Generates code to perform a ParameterModel.
[SuppressMessageAttribute("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] [SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] protected virtual void Generate( ParameterModel parameterModel, IndentedTextWriter writer, bool emitName = false )
Parameters
- parameterModel
-
Type:
System.Data.Entity.Migrations.Model.ParameterModel
The parameter model definition to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
- emitName
-
Type:
System.Boolean
true to include the column name in the definition; otherwise, false.
VisualBasicMigrationCodeGenerator.Generate Method (RenameColumnOperation, IndentedTextWriter)
Generates code to perform a RenameColumnOperation.
protected virtual void Generate( RenameColumnOperation renameColumnOperation, IndentedTextWriter writer )
Parameters
- renameColumnOperation
-
Type:
System.Data.Entity.Migrations.Model.RenameColumnOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (RenameIndexOperation, IndentedTextWriter)
Generates code to perform a RenameIndexOperation.
protected virtual void Generate( RenameIndexOperation renameIndexOperation, IndentedTextWriter writer )
Parameters
- renameIndexOperation
-
Type:
System.Data.Entity.Migrations.Model.RenameIndexOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (RenameProcedureOperation, IndentedTextWriter)
Generates code to perform a RenameProcedureOperation.
protected virtual void Generate( RenameProcedureOperation renameProcedureOperation, IndentedTextWriter writer )
Parameters
- renameProcedureOperation
-
Type:
System.Data.Entity.Migrations.Model.RenameProcedureOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (RenameTableOperation, IndentedTextWriter)
Generates code to perform a RenameTableOperation.
protected virtual void Generate( RenameTableOperation renameTableOperation, IndentedTextWriter writer )
Parameters
- renameTableOperation
-
Type:
System.Data.Entity.Migrations.Model.RenameTableOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (Single)
Generates code to specify the default value for a Single column.
Parameters
- defaultValue
-
Type:
System.Single
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (SqlOperation, IndentedTextWriter)
Generates code to perform a SqlOperation.
Parameters
- sqlOperation
-
Type:
System.Data.Entity.Migrations.Model.SqlOperation
The operation to generate code for.
- writer
-
Type:
System.Data.Entity.Migrations.Utilities.IndentedTextWriter
Text writer to add the generated code to.
VisualBasicMigrationCodeGenerator.Generate Method (String)
Generates code to specify the default value for a String column.
Parameters
- defaultValue
-
Type:
System.String
The value to be used as the default.
VisualBasicMigrationCodeGenerator.Generate Method (String, IEnumerable<MigrationOperation>, String, String, String, String)
Generates the code behind file with migration metadata.
public override ScaffoldedMigration Generate( string migrationId, IEnumerable<MigrationOperation> operations, string sourceModel, string targetModel, string namespace, string className )
Parameters
- migrationId
-
Type:
System.String
Unique identifier of the migration.
- operations
-
Type:
System.Collections.Generic.IEnumerable<MigrationOperation>
Operations to be performed by the migration.
- sourceModel
-
Type:
System.String
Source model to be stored in the migration metadata.
- targetModel
-
Type:
System.String
Target model to be stored in the migration metadata.
- namespace
-
Type:
System.String
Namespace that code should be generated in.
- className
-
Type:
System.String
Name of the class that should be generated.
VisualBasicMigrationCodeGenerator.Generate Method (String, String, String, String, String)
Generates the code behind file with migration metadata.
[SuppressMessageAttribute("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")] [SuppressMessageAttribute("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "namespace")] protected virtual string Generate( string migrationId, string sourceModel, string targetModel, string namespace, string className )
Parameters
- migrationId
-
Type:
System.String
Unique identifier of the migration.
- sourceModel
-
Type:
System.String
Source model to be stored in the migration metadata.
- targetModel
-
Type:
System.String
Target model to be stored in the migration metadata.
- namespace
-
Type:
System.String
Namespace that code should be generated in.
- className
-
Type:
System.String
Name of the class that should be generated.
VisualBasicMigrationCodeGenerator.Generate Method (TimeSpan)
Generates code to specify the default value for a TimeSpan column.
Parameters
- defaultValue
-
Type:
System.TimeSpan
The value to be used as the default.