【发布时间】:2018-11-26 20:50:24
【问题描述】:
使用 ASP.Net Core 2.1,我试图向默认的 Microsoft Identity Users 表结构添加一个新字段,因此我创建了一个新模型,用于在项目数据库上下文中继承 Microsoft.AspNetCore.Identity,我曾经成功实现过下面的代码,但这次出错了。
这是模型:
public class ApplicationUser : IdentityUser
{
public string Age { get; set; }
}
这是数据库上下文:
public class ApplicationDbContext : IdentityDbContext<ApplicationUser, string>
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) { }
public string CurrentUserId { get; set; }
}
这是输出错误:
非泛型类型“IdentityDbContext”不能与类型参数一起使用
我在这里做错了什么?
【问题讨论】:
标签: c# asp.net-core asp.net-identity