将 efcore 迁移到版本 3.1 时出错



>迁移到 efcore3.1 时出现错误

这行代码显示错误:

entity.HasOne(d => d.ContentControl)
.WithMany(p => p.Content)
.HasForeignKey(d => d.ContentControlId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_Content_ContentControl");

错误:

错误 CS7069 对类型"ReferenceOwnershipBuilder<,>"的引用声称它在"Microsoft.EntityFrameworkCore"中定义,但找不到

我该如何解决这个问题?

可能错过了升级依赖包,如Microsoft.EntityFrameworkCore.SQLServer。检查一下。

相关内容

最新更新