VisualBasicMigrationCodeGenerator.Generate 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Generate(CreateProcedureOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- createProcedureOperation
- CreateProcedureOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(CreateTableOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- createTableOperation
- CreateTableOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(DropColumnOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- dropColumnOperation
- DropColumnOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(DropForeignKeyOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- dropForeignKeyOperation
- DropForeignKeyOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(DropIndexOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- dropIndexOperation
- DropIndexOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(DropProcedureOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- dropProcedureOperation
- DropProcedureOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(DropTableOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- dropTableOperation
- DropTableOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(MoveProcedureOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- moveProcedureOperation
- MoveProcedureOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(MoveTableOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- moveTableOperation
- MoveTableOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(RenameColumnOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- renameColumnOperation
- RenameColumnOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(RenameIndexOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- renameIndexOperation
- RenameIndexOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(RenameProcedureOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- renameProcedureOperation
- RenameProcedureOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(RenameTableOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- renameTableOperation
- RenameTableOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(SqlOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- sqlOperation
- SqlOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(IEnumerable<MigrationOperation>, String, String)
產生使用者可檢視和編輯的主要程式碼檔案。
[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
參數
- operations
- IEnumerable<MigrationOperation>
移轉所要執行的作業。
- namespace
- String
應該在 中產生程式碼的命名空間。
- className
- String
應該產生的類別名稱。
傳回
產生的程式碼。
- 屬性
適用於
Generate(ColumnModel, IndentedTextWriter, Boolean)
產生程式碼以指定 的定義 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)
參數
- column
- ColumnModel
要為其產生程式碼的資料行定義。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
- emitName
- Boolean
值,指出是否要在定義中包含資料行名稱。
- 屬性
適用於
Generate(ParameterModel, IndentedTextWriter, Boolean)
產生程式碼以執行 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
參數
- parameterModel
- ParameterModel
要為其產生程式碼的參數模型定義。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
- emitName
- Boolean
true 表示在定義中包含資料行名稱;否則為 false。
- 屬性
適用於
Generate(String, String, String, String, String)
使用移轉中繼資料產生檔案後置程式碼。
[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
參數
- migrationId
- String
移轉的唯一識別碼。
- sourceModel
- String
要儲存在移轉中繼資料中的來源模型。
- targetModel
- String
要儲存在移轉中繼資料中的目標模型。
- namespace
- String
應該在 中產生程式碼的命名空間。
- className
- String
應該產生的類別名稱。
傳回
產生的程式碼。
- 屬性
適用於
Generate(String, IEnumerable<MigrationOperation>, String, String, String, String)
產生應該新增至使用者專案的程式碼。
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
參數
- migrationId
- String
移轉的唯一識別碼。
- operations
- IEnumerable<MigrationOperation>
移轉所要執行的作業。
- sourceModel
- String
要儲存在移轉中繼資料中的來源模型。
- targetModel
- String
要儲存在移轉中繼資料中的目標模型。
- namespace
- String
應該在 中產生程式碼的命名空間。
- className
- String
應該產生的類別名稱。
傳回
產生的程式碼。
適用於
Generate(CreateIndexOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- createIndexOperation
- CreateIndexOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(AlterTableOperation, IndentedTextWriter)
產生 的程式 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
參數
- alterTableOperation
- AlterTableOperation
應該產生程式碼的作業。
- writer
- IndentedTextWriter
應該寫入所產生程式碼的寫入器。
適用於
Generate(DropPrimaryKeyOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- dropPrimaryKeyOperation
- DropPrimaryKeyOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(AlterColumnOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- alterColumnOperation
- AlterColumnOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(Byte)
Generate(Byte[])
Generate(DbGeography)
產生程式碼以指定資料行的 DbGeography 預設值。
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
參數
- defaultValue
- DbGeography
要當做預設值使用的值。
傳回
代表預設值的程式碼。
適用於
Generate(AlterProcedureOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- alterProcedureOperation
- AlterProcedureOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(DbGeography)
產生程式碼以指定資料行的 DbGeography 預設值。
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
參數
- defaultValue
- DbGeography
要當做預設值使用的值。
傳回
代表預設值的程式碼。
適用於
Generate(DbGeometry)
產生程式碼以指定資料行的 DbGeometry 預設值。
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
參數
- defaultValue
- DbGeometry
要當做預設值使用的值。
傳回
代表預設值的程式碼。
適用於
Generate(DateTime)
Generate(DateTimeOffset)
產生程式碼以指定資料行的 DateTimeOffset 預設值。
protected virtual string Generate (DateTimeOffset defaultValue);
override this.Generate : DateTimeOffset -> string
Protected Overridable Function Generate (defaultValue As DateTimeOffset) As String
參數
- defaultValue
- DateTimeOffset
要當做預設值使用的值。
傳回
代表預設值的程式碼。
適用於
Generate(Decimal)
Generate(Guid)
Generate(DbGeometry)
產生程式碼以指定資料行的 DbGeometry 預設值。
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
參數
- defaultValue
- DbGeometry
要當做預設值使用的值。
傳回
代表預設值的程式碼。
適用於
Generate(Object)
產生程式碼,以指定未知資料類型之資料行的預設值。
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
參數
- defaultValue
- Object
要當做預設值使用的值。
傳回
代表預設值的程式碼。
- 屬性
適用於
Generate(Single)
Generate(String)
Generate(Int64)
Generate(TimeSpan)
Generate(IEnumerable<String>, IndentedTextWriter)
產生程式碼,以使用 Lambda 運算式指定一組資料行名稱。
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)
參數
- columns
- IEnumerable<String>
要為其產生程式碼的資料行。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(AddColumnOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- addColumnOperation
- AddColumnOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(AddForeignKeyOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- addForeignKeyOperation
- AddForeignKeyOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。
適用於
Generate(AddPrimaryKeyOperation, IndentedTextWriter)
產生程式碼以執行 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
參數
- addPrimaryKeyOperation
- AddPrimaryKeyOperation
要為其產生程式碼的作業。
- writer
- IndentedTextWriter
要加入所產生程式碼的文字寫入器。