CSharpMigrationsGenerator 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
用來產生 C# 遷移程式碼。
public class CSharpMigrationsGenerator : Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsCodeGenerator
[System.Runtime.CompilerServices.Nullable(0)]
public class CSharpMigrationsGenerator : Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsCodeGenerator
type CSharpMigrationsGenerator = class
inherit MigrationsCodeGenerator
[<System.Runtime.CompilerServices.Nullable(0)>]
type CSharpMigrationsGenerator = class
inherit MigrationsCodeGenerator
Public Class CSharpMigrationsGenerator
Inherits MigrationsCodeGenerator
- 繼承
- 屬性
備註
更多資訊與範例請參閱 資料庫遷移及 EF Core 設計時服務 。
建構函式
屬性
| 名稱 | Description |
|---|---|
| CSharpDependencies |
此服務的依賴關係。 |
| Dependencies |
此服務的依賴關係。 (繼承來源 MigrationsCodeGenerator) |
| FileExtension |
取得檔案應該使用的副檔名代碼。 |
| Language |
取得此服務支援的程式語言。 |
方法
| 名稱 | Description |
|---|---|
| GenerateMetadata(String, Type, String, String, IModel) |
產生遷移的元資料程式碼。 |
| GenerateMigration(String, String, IReadOnlyList<MigrationOperation>, IReadOnlyList<MigrationOperation>) |
產生遷移程式碼。 |
| GenerateSnapshot(String, Type, String, IModel, String) |
產生模型快照程式碼。 |
| GenerateSnapshot(String, Type, String, IModel) |
產生模型快照程式碼。 |
| GetNamespaces(IEnumerable<MigrationOperation>) |
取得物件清單 MigrationOperation 所需的命名空間。 (繼承來源 MigrationsCodeGenerator) |
| GetNamespaces(IModel) |
取得所需的命名空間。IModel (繼承來源 MigrationsCodeGenerator) |