我正在使用带有 EFcore 的 Asp.Net core 3.0 构建 Web API。我正在使用代码优先的方法。我使用此模型进行了初始迁移
public class Group {
[Key]
public int Id{get;set;}
public string Title { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
后来我给这个模型加了外键关系
public class Group {
[Key]
public int Id{get;set;}
public string Title { get; set; }
[ForeignKey("UserId")]
public User User { get; set; }
public int UserId { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
当我Add-Migration <migrationName>在PMC. 但是当我运行时出现update-database此错误:SQLite 不支持此迁移操作 ('DropForeignKeyOperation')