EFCore使用Oracle序列
- 找到DBContext上下文
- 在OnModelCreating方法中增加以下代码
modelBuilder.Entity<实体类名称>(entity =>
{
entity.ToTable("实体类名称");
entity.Property(o => o.USER_ID).ForOracleUseSequenceHiLo("序列名称");
});
这样就完成了。
参考文章:https://www.cnblogs.com/GuZhenYin/p/10756548.html