小编Ndu*_* Jr的帖子

SQLite 不支持此迁移操作 ('DropForeignKeyOperation')

我正在使用带有 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')

c# sqlite entity-framework-core

5
推荐指数
1
解决办法
2694
查看次数

标签 统计

c# ×1

entity-framework-core ×1

sqlite ×1