【发布时间】:2021-08-05 06:17:55
【问题描述】:
我创建了一个数据上下文,其中所有身份表都以 Guid 作为主键,但迁移后的 IdentityUserClaim 和 IdentityRoleClaim 表仍然是仍然有 int 作为主键。有什么方法可以将其更改为 Guid 作为主键
public class DataContext: IdentityDbContext<IdentityUser<Guid>, IdentityRole<Guid>, Guid, IdentityUserClaim<Guid>, IdentityUserRole<Guid>, IdentityUserLogin<Guid>, IdentityRoleClaim<Guid>, IdentityUserToken<Guid>>
{
public DataContext(DbContextOptions<DataContext> options): base(options)
{
}
}
【问题讨论】:
-
我正在使用 .net core 5.0 和 entityframework 核心代码优先方法
-
你能显示迁移吗?
标签: c# .net .net-core entity-framework-core asp.net-identity