语言

IMigrationsSqlGenerator 接口

定义

一个用于生成 MigrationCommand 对象的服务,然后可以从列表 MigrationOperation执行或编写脚本。

public interface IMigrationsSqlGenerator
type IMigrationsSqlGenerator = interface
Public Interface IMigrationsSqlGenerator
派生

注解

服务生存期为 Scoped。 这意味着每个 DbContext 实例都将使用此服务自己的实例。 实现可能依赖于注册到任何生存期的其他服务。 实现不需要线程安全。

有关详细信息和示例,请参阅 数据库迁移 。

方法

名称 说明
Generate(IReadOnlyList<MigrationOperation>, IModel, MigrationsSqlGenerationOptions)

从操作列表中生成命令。

Generate(IReadOnlyList<MigrationOperation>, IModel)

从操作列表中生成命令。

适用于