語言

MigrationCodeGenerator.Generate 方法

定義

產生應該加入使用者專案的程式碼。

public abstract 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);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId="namespace")]
public abstract 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);
abstract member Generate : string * seq<System.Data.Entity.Migrations.Model.MigrationOperation> * string * string * string * string -> System.Data.Entity.Migrations.Design.ScaffoldedMigration
Public MustOverride 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

應該產生的類別名稱。

傳回

生成的程式碼。

屬性

適用於