MigrationCodeGenerator.Generate メソッド
[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]
ユーザーのプロジェクトに追加するコードを生成します。
名前空間: System.Data.Entity.Migrations.Design
アセンブリ: EntityFramework (EntityFramework.dll 内)
構文
'宣言
<SuppressMessageAttribute("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId := "namespace")> _
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
'使用
Dim instance As MigrationCodeGenerator
Dim migrationId As String
Dim operations As IEnumerable(Of MigrationOperation)
Dim sourceModel As String
Dim targetModel As String
Dim namespace As String
Dim className As String
Dim returnValue As ScaffoldedMigration
returnValue = instance.Generate(migrationId, _
operations, sourceModel, targetModel, _
namespace, className)
[SuppressMessageAttribute("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "namespace")]
public abstract ScaffoldedMigration Generate(
string migrationId,
IEnumerable<MigrationOperation> operations,
string sourceModel,
string targetModel,
string namespace,
string className
)
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1716:IdentifiersShouldNotMatchKeywords", MessageId = L"namespace")]
public:
virtual ScaffoldedMigration^ Generate(
String^ migrationId,
IEnumerable<MigrationOperation^>^ operations,
String^ sourceModel,
String^ targetModel,
String^ namespace,
String^ className
) abstract
[<SuppressMessageAttribute("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "namespace")>]
abstract Generate :
migrationId:string *
operations:IEnumerable<MigrationOperation> *
sourceModel:string *
targetModel:string *
namespace:string *
className:string -> ScaffoldedMigration
public abstract function Generate(
migrationId : String,
operations : IEnumerable<MigrationOperation>,
sourceModel : String,
targetModel : String,
namespace : String,
className : String
) : ScaffoldedMigration
パラメーター
- migrationId
型 : System.String
移行の一意の識別子。
- operations
型 : System.Collections.Generic.IEnumerable<MigrationOperation>
移行で実行される操作。
- sourceModel
型 : System.String
移行のメタデータに格納されるソース モデル。
- targetModel
型 : System.String
移行のメタデータに格納されるターゲット モデル。
- namespace
型 : System.String
コードが生成される名前空間。
- className
型 : System.String
生成されるクラスの名前。
戻り値
型 : System.Data.Entity.Migrations.Design.ScaffoldedMigration
生成されたコード。