CSharpMigrationsGenerator.GenerateSnapshot 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| GenerateSnapshot(String, Type, String, IModel) |
產生模型快照程式碼。 |
| GenerateSnapshot(String, Type, String, IModel, String) |
產生模型快照程式碼。 |
GenerateSnapshot(String, Type, String, IModel)
產生模型快照程式碼。
public override string GenerateSnapshot(string modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model);
public override string GenerateSnapshot(string? modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model);
override this.GenerateSnapshot : string * Type * string * Microsoft.EntityFrameworkCore.Metadata.IModel -> string
Public Overrides Function GenerateSnapshot (modelSnapshotNamespace As String, contextType As Type, modelSnapshotName As String, model As IModel) As String
參數
- modelSnapshotNamespace
- String
模型快照的命名空間。
- modelSnapshotName
- String
模型快照的名字。
- model
- IModel
模型。
傳回
模型快照程式碼。
適用於
GenerateSnapshot(String, Type, String, IModel, String)
產生模型快照程式碼。
public override string GenerateSnapshot(string? modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model, string? latestMigrationId = default);
override this.GenerateSnapshot : string * Type * string * Microsoft.EntityFrameworkCore.Metadata.IModel * string -> string
Public Overrides Function GenerateSnapshot (modelSnapshotNamespace As String, contextType As Type, modelSnapshotName As String, model As IModel, Optional latestMigrationId As String = Nothing) As String
參數
- modelSnapshotNamespace
- String
模型快照的命名空間。
- modelSnapshotName
- String
模型快照的名字。
- model
- IModel
模型。
- latestMigrationId
- String
這是套用到模型的最新遷移ID。
傳回
模型快照程式碼。