Share via


VisualBasicMigrationCodeGenerator.Generate Method

Definition

Overloads

Generate(CreateProcedureOperation, IndentedTextWriter)

Generates code to perform a CreateProcedureOperation.

Generate(CreateTableOperation, IndentedTextWriter)

Generates code to perform a CreateTableOperation.

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(DropProcedureOperation, IndentedTextWriter)

Generates code to perform a DropProcedureOperation.

Generate(DropTableOperation, IndentedTextWriter)

Generates code to perform a DropTableOperation.

Generate(MoveProcedureOperation, IndentedTextWriter)

Generates code to perform a MoveProcedureOperation.

Generate(MoveTableOperation, IndentedTextWriter)

Generates code to perform a MoveTableOperation.

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(SqlOperation, IndentedTextWriter)

Generates code to perform a SqlOperation.

Generate(IEnumerable<MigrationOperation>, String, String)

Generates the primary code file that the user can view and edit.

Generate(ColumnModel, IndentedTextWriter, Boolean)

Generates code to specify the definition for a ColumnModel.

Generate(ParameterModel, IndentedTextWriter, Boolean)

Generates code to perform a ParameterModel.

Generate(String, String, String, String, String)

Generates the code behind file with migration metadata.

Generate(String, IEnumerable<MigrationOperation>, String, String, String, String)

Generates the code that should be added to the users project.

Generate(CreateIndexOperation, IndentedTextWriter)

Generates code to perform a CreateIndexOperation.

Generate(AlterTableOperation, IndentedTextWriter)

Generates code for an AlterTableOperation.

Generate(DropPrimaryKeyOperation, IndentedTextWriter)

Generates code to perform a DropPrimaryKeyOperation.

Generate(AlterColumnOperation, IndentedTextWriter)

Generates code to perform an AlterColumnOperation.

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(DbGeography)

Generates code to specify the default value for a DbGeography column.

Generate(AlterProcedureOperation, IndentedTextWriter)

Generates code to perform a AlterProcedureOperation.

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(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(Decimal)

Generates code to specify the default value for a Decimal column.

Generate(Guid)

Generates code to specify the default value for a Guid column.

Generate(DbGeometry)

Generates code to specify the default value for a DbGeometry column.

Generate(Object)

Generates code to specify the default value for a column of unknown data type.

Generate(Single)

Generates code to specify the default value for a Single column.

Generate(String)

Generates code to specify the default value for a String column.

Generate(Int64)

Generates code to specify the default value for a Int64 column.

Generate(TimeSpan)

Generates code to specify the default value for a TimeSpan column.

Generate(IEnumerable<String>, IndentedTextWriter)

Generates code to specify a set of column names using a lambda expression.

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(CreateProcedureOperation, IndentedTextWriter)

Generates code to perform a CreateProcedureOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.CreateProcedureOperation createProcedureOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.CreateProcedureOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

createProcedureOperation
CreateProcedureOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(CreateTableOperation, IndentedTextWriter)

Generates code to perform a CreateTableOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.CreateTableOperation createTableOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.CreateTableOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

createTableOperation
CreateTableOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(DropColumnOperation, IndentedTextWriter)

Generates code to perform a DropColumnOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropColumnOperation dropColumnOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.DropColumnOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

dropColumnOperation
DropColumnOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(DropForeignKeyOperation, IndentedTextWriter)

Generates code to perform a DropForeignKeyOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropForeignKeyOperation dropForeignKeyOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.DropForeignKeyOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

dropForeignKeyOperation
DropForeignKeyOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(DropIndexOperation, IndentedTextWriter)

Generates code to perform a DropIndexOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropIndexOperation dropIndexOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.DropIndexOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

dropIndexOperation
DropIndexOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(DropProcedureOperation, IndentedTextWriter)

Generates code to perform a DropProcedureOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropProcedureOperation dropProcedureOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.DropProcedureOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

dropProcedureOperation
DropProcedureOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(DropTableOperation, IndentedTextWriter)

Generates code to perform a DropTableOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropTableOperation dropTableOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.DropTableOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

dropTableOperation
DropTableOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(MoveProcedureOperation, IndentedTextWriter)

Generates code to perform a MoveProcedureOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.MoveProcedureOperation moveProcedureOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.MoveProcedureOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

moveProcedureOperation
MoveProcedureOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(MoveTableOperation, IndentedTextWriter)

Generates code to perform a MoveTableOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.MoveTableOperation moveTableOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.MoveTableOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

moveTableOperation
MoveTableOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(RenameColumnOperation, IndentedTextWriter)

Generates code to perform a RenameColumnOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.RenameColumnOperation renameColumnOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.RenameColumnOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

renameColumnOperation
RenameColumnOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(RenameIndexOperation, IndentedTextWriter)

Generates code to perform a RenameIndexOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.RenameIndexOperation renameIndexOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.RenameIndexOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

renameIndexOperation
RenameIndexOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(RenameProcedureOperation, IndentedTextWriter)

Generates code to perform a RenameProcedureOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.RenameProcedureOperation renameProcedureOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.RenameProcedureOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

renameProcedureOperation
RenameProcedureOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(RenameTableOperation, IndentedTextWriter)

Generates code to perform a RenameTableOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.RenameTableOperation renameTableOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.RenameTableOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

renameTableOperation
RenameTableOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(SqlOperation, IndentedTextWriter)

Generates code to perform a SqlOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.SqlOperation sqlOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.SqlOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

sqlOperation
SqlOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(IEnumerable<MigrationOperation>, String, String)

Generates the primary code file that the user can view and edit.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
protected virtual string Generate (System.Collections.Generic.IEnumerable<System.Data.Entity.Migrations.Model.MigrationOperation> operations, string namespace, string className);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId="namespace")]
protected virtual string Generate (System.Collections.Generic.IEnumerable<System.Data.Entity.Migrations.Model.MigrationOperation> operations, string namespace, string className);
override this.Generate : seq<System.Data.Entity.Migrations.Model.MigrationOperation> * string * string -> string
Protected Overridable Function Generate (operations As IEnumerable(Of MigrationOperation), namespace As String, className As String) As String

Parameters

operations
IEnumerable<MigrationOperation>

Operations to be performed by the migration.

namespace
String

Namespace that code should be generated in.

className
String

Name of the class that should be generated.

Returns

The generated code.

Attributes

Applies to

Generate(ColumnModel, IndentedTextWriter, Boolean)

Generates code to specify the definition for a ColumnModel.

protected virtual void Generate (System.Data.Entity.Migrations.Model.ColumnModel column, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer, bool emitName = false);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")]
protected virtual void Generate (System.Data.Entity.Migrations.Model.ColumnModel column, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer, bool emitName = false);
override this.Generate : System.Data.Entity.Migrations.Model.ColumnModel * System.Data.Entity.Migrations.Utilities.IndentedTextWriter * bool -> unit
Protected Overridable Sub Generate (column As ColumnModel, writer As IndentedTextWriter, Optional emitName As Boolean = false)

Parameters

column
ColumnModel

The column definition to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

emitName
Boolean

A value indicating whether to include the column name in the definition.

Attributes

Applies to

Generate(ParameterModel, IndentedTextWriter, Boolean)

Generates code to perform a ParameterModel.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")]
protected virtual void Generate (System.Data.Entity.Migrations.Model.ParameterModel parameterModel, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer, bool emitName = false);
override this.Generate : System.Data.Entity.Migrations.Model.ParameterModel * System.Data.Entity.Migrations.Utilities.IndentedTextWriter * bool -> unit

Parameters

parameterModel
ParameterModel

The parameter model definition to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

emitName
Boolean

true to include the column name in the definition; otherwise, false.

Attributes

Applies to

Generate(String, String, String, String, String)

Generates the code behind file with migration metadata.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
protected virtual string Generate (string migrationId, string sourceModel, string targetModel, string namespace, string className);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId="namespace")]
protected virtual string Generate (string migrationId, string sourceModel, string targetModel, string namespace, string className);
override this.Generate : string * string * string * string * string -> string
Protected Overridable Function Generate (migrationId As String, sourceModel As String, targetModel As String, namespace As String, className As String) As String

Parameters

migrationId
String

Unique identifier of the migration.

sourceModel
String

Source model to be stored in the migration metadata.

targetModel
String

Target model to be stored in the migration metadata.

namespace
String

Namespace that code should be generated in.

className
String

Name of the class that should be generated.

Returns

The generated code.

Attributes

Applies to

Generate(String, IEnumerable<MigrationOperation>, String, String, String, String)

Generates the code that should be added to the users project.

public override System.Data.Entity.Migrations.Design.ScaffoldedMigration Generate (string migrationId, System.Collections.Generic.IEnumerable<System.Data.Entity.Migrations.Model.MigrationOperation> operations, string sourceModel, string targetModel, string namespace, string className);
override this.Generate : string * seq<System.Data.Entity.Migrations.Model.MigrationOperation> * string * string * string * string -> System.Data.Entity.Migrations.Design.ScaffoldedMigration
Public Overrides Function Generate (migrationId As String, operations As IEnumerable(Of MigrationOperation), sourceModel As String, targetModel As String, namespace As String, className As String) As ScaffoldedMigration

Parameters

migrationId
String

Unique identifier of the migration.

operations
IEnumerable<MigrationOperation>

Operations to be performed by the migration.

sourceModel
String

Source model to be stored in the migration metadata.

targetModel
String

Target model to be stored in the migration metadata.

namespace
String

Namespace that code should be generated in.

className
String

Name of the class that should be generated.

Returns

The generated code.

Applies to

Generate(CreateIndexOperation, IndentedTextWriter)

Generates code to perform a CreateIndexOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.CreateIndexOperation createIndexOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.CreateIndexOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

createIndexOperation
CreateIndexOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(AlterTableOperation, IndentedTextWriter)

Generates code for an AlterTableOperation.

protected internal virtual void Generate (System.Data.Entity.Migrations.Model.AlterTableOperation alterTableOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.AlterTableOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

alterTableOperation
AlterTableOperation

The operation for which code should be generated.

writer
IndentedTextWriter

The writer to which generated code should be written.

Applies to

Generate(DropPrimaryKeyOperation, IndentedTextWriter)

Generates code to perform a DropPrimaryKeyOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation dropPrimaryKeyOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.DropPrimaryKeyOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

dropPrimaryKeyOperation
DropPrimaryKeyOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(AlterColumnOperation, IndentedTextWriter)

Generates code to perform an AlterColumnOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AlterColumnOperation alterColumnOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.AlterColumnOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

alterColumnOperation
AlterColumnOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(Byte)

Generates code to specify the default value for a Byte column.

protected virtual string Generate (byte defaultValue);
override this.Generate : byte -> string
Protected Overridable Function Generate (defaultValue As Byte) As String

Parameters

defaultValue
Byte

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(Byte[])

Generates code to specify the default value for a byte[] column.

protected virtual string Generate (byte[] defaultValue);
override this.Generate : byte[] -> string
Protected Overridable Function Generate (defaultValue As Byte()) As String

Parameters

defaultValue
Byte[]

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(DbGeography)

Generates code to specify the default value for a DbGeography column.

protected virtual string Generate (System.Data.Entity.Spatial.DbGeography defaultValue);
override this.Generate : System.Data.Entity.Spatial.DbGeography -> string
Protected Overridable Function Generate (defaultValue As DbGeography) As String

Parameters

defaultValue
DbGeography

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(AlterProcedureOperation, IndentedTextWriter)

Generates code to perform a AlterProcedureOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AlterProcedureOperation alterProcedureOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.AlterProcedureOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

alterProcedureOperation
AlterProcedureOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(DbGeography)

Generates code to specify the default value for a DbGeography column.

protected virtual string Generate (System.Data.Spatial.DbGeography defaultValue);
override this.Generate : System.Data.Spatial.DbGeography -> string
Protected Overridable Function Generate (defaultValue As DbGeography) As String

Parameters

defaultValue
DbGeography

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(DbGeometry)

Generates code to specify the default value for a DbGeometry column.

protected virtual string Generate (System.Data.Spatial.DbGeometry defaultValue);
override this.Generate : System.Data.Spatial.DbGeometry -> string
Protected Overridable Function Generate (defaultValue As DbGeometry) As String

Parameters

defaultValue
DbGeometry

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(DateTime)

Generates code to specify the default value for a DateTime column.

protected virtual string Generate (DateTime defaultValue);
override this.Generate : DateTime -> string
Protected Overridable Function Generate (defaultValue As DateTime) As String

Parameters

defaultValue
DateTime

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(DateTimeOffset)

Generates code to specify the default value for a DateTimeOffset column.

protected virtual string Generate (DateTimeOffset defaultValue);
override this.Generate : DateTimeOffset -> string
Protected Overridable Function Generate (defaultValue As DateTimeOffset) As String

Parameters

defaultValue
DateTimeOffset

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(Decimal)

Generates code to specify the default value for a Decimal column.

protected virtual string Generate (decimal defaultValue);
override this.Generate : decimal -> string
Protected Overridable Function Generate (defaultValue As Decimal) As String

Parameters

defaultValue
Decimal

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(Guid)

Generates code to specify the default value for a Guid column.

protected virtual string Generate (Guid defaultValue);
override this.Generate : Guid -> string
Protected Overridable Function Generate (defaultValue As Guid) As String

Parameters

defaultValue
Guid

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(DbGeometry)

Generates code to specify the default value for a DbGeometry column.

protected virtual string Generate (System.Data.Entity.Spatial.DbGeometry defaultValue);
override this.Generate : System.Data.Entity.Spatial.DbGeometry -> string
Protected Overridable Function Generate (defaultValue As DbGeometry) As String

Parameters

defaultValue
DbGeometry

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(Object)

Generates code to specify the default value for a column of unknown data type.

protected virtual string Generate (object defaultValue);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")]
protected virtual string Generate (object defaultValue);
override this.Generate : obj -> string
Protected Overridable Function Generate (defaultValue As Object) As String

Parameters

defaultValue
Object

The value to be used as the default.

Returns

Code representing the default value.

Attributes

Applies to

Generate(Single)

Generates code to specify the default value for a Single column.

protected virtual string Generate (float defaultValue);
override this.Generate : single -> string
Protected Overridable Function Generate (defaultValue As Single) As String

Parameters

defaultValue
Single

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(String)

Generates code to specify the default value for a String column.

protected virtual string Generate (string defaultValue);
override this.Generate : string -> string
Protected Overridable Function Generate (defaultValue As String) As String

Parameters

defaultValue
String

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(Int64)

Generates code to specify the default value for a Int64 column.

protected virtual string Generate (long defaultValue);
override this.Generate : int64 -> string
Protected Overridable Function Generate (defaultValue As Long) As String

Parameters

defaultValue
Int64

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(TimeSpan)

Generates code to specify the default value for a TimeSpan column.

protected virtual string Generate (TimeSpan defaultValue);
override this.Generate : TimeSpan -> string
Protected Overridable Function Generate (defaultValue As TimeSpan) As String

Parameters

defaultValue
TimeSpan

The value to be used as the default.

Returns

Code representing the default value.

Applies to

Generate(IEnumerable<String>, IndentedTextWriter)

Generates code to specify a set of column names using a lambda expression.

protected virtual void Generate (System.Collections.Generic.IEnumerable<string> columns, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : seq<string> * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit
Protected Overridable Sub Generate (columns As IEnumerable(Of String), writer As IndentedTextWriter)

Parameters

columns
IEnumerable<String>

The columns to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(AddColumnOperation, IndentedTextWriter)

Generates code to perform an AddColumnOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AddColumnOperation addColumnOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.AddColumnOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

addColumnOperation
AddColumnOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(AddForeignKeyOperation, IndentedTextWriter)

Generates code to perform an AddForeignKeyOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AddForeignKeyOperation addForeignKeyOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.AddForeignKeyOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

addForeignKeyOperation
AddForeignKeyOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to

Generate(AddPrimaryKeyOperation, IndentedTextWriter)

Generates code to perform an AddPrimaryKeyOperation.

protected virtual void Generate (System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation addPrimaryKeyOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer);
override this.Generate : System.Data.Entity.Migrations.Model.AddPrimaryKeyOperation * System.Data.Entity.Migrations.Utilities.IndentedTextWriter -> unit

Parameters

addPrimaryKeyOperation
AddPrimaryKeyOperation

The operation to generate code for.

writer
IndentedTextWriter

Text writer to add the generated code to.

Applies to