【发布时间】:2021-05-14 10:34:07
【问题描述】:
我将 FluentMigrator 与 MySql 和 C# 一起使用。
[Migration(3)]
public class _0003_TestMigrationTI : Migration
{
public override void Up()
{
Insert.IntoTable("cmn_file_types").Row(new { Name = "Image", Code = "IMG" });
???
}
}
如何在 same Up() 方法中的 Insert.IntoTable 之后获取最后插入的 id? ID 是 cmn_file_types 表中的一个 INT PRIMARY AUTO_INCREMENT 列。
【问题讨论】:
-
这可能是一个重复的问题。这是我发现的搜索结果:stackoverflow.com/questions/24167605/…
标签: c# mysql fluent-migrator last-insert-id