小编gol*_*ldN的帖子

EF Core - 值不能为空。(参数“键”)

我遇到的问题是 EF Core 不允许我添加第二次迁移。\n我有以下 DataContext 设置:

\n\n
public class DataContext : IdentityDbContext<User, Role, Guid, IdentityUserClaim<Guid>, UserRole, IdentityUserLogin<Guid>, IdentityRoleClaim<Guid>, IdentityUserToken<Guid>>\n{\n    public DataContext(DbContextOptions<DataContext> options)\n        : base(options)\n    {\n    }\n\n    /* Global */\n    public virtual DbSet<Audit> Audits { get; set; }\n    public virtual DbSet<AuditType> AuditType { get; set; }\n\n    /* Portal */\n    public virtual DbSet<RefreshToken> RefreshTokens { get; set; }\n    public virtual DbSet<Product> Products { get; set; }\n    public virtual DbSet<Group> Groups { get; set; }\n    public virtual DbSet<GroupType> GroupTypes { get; set; }\n …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework .net-core

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

标签 统计

.net-core ×1

c# ×1

entity-framework ×1