IMigrationsCodeGenerator.GenerateSnapshot 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| GenerateSnapshot(String, Type, String, IModel) |
生成模型快照代码。 |
| GenerateSnapshot(String, Type, String, IModel, String) |
生成模型快照代码。 |
GenerateSnapshot(String, Type, String, IModel)
- Source:
- IMigrationsCodeGenerator.cs
- Source:
- IMigrationsCodeGenerator.cs
- Source:
- IMigrationsCodeGenerator.cs
- Source:
- IMigrationsCodeGenerator.cs
生成模型快照代码。
public string GenerateSnapshot(string? modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model);
public string GenerateSnapshot(string modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model);
abstract member GenerateSnapshot : string * Type * string * Microsoft.EntityFrameworkCore.Metadata.IModel -> string
Public 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)
- Source:
- IMigrationsCodeGenerator.cs
生成模型快照代码。
public string GenerateSnapshot(string? modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model, string? latestMigrationId = default);
abstract member GenerateSnapshot : string * Type * string * Microsoft.EntityFrameworkCore.Metadata.IModel * string -> string
Public 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。
返回
模型快照代码。