ASP IdentityFramework:向 AspNetUsers table 添加了个性化 属性 但 IdentityUser 模型未更新

ASP IdentityFramework: Added personalized property to AspNetUsers table but IdentityUser model was not updated

快速提问。 我向名为“WebSiteName”的 AspNetUser table 添加了个性化 属性,现在我正在修改注册页面以便能够输入新信息,但我发现 IdentityUser 模型没有更新,我是无法设置我的 属性。我错过了什么?我需要再次搭建脚手架吗?

我已经添加了迁移并更新了数据库。

这是我添加道具的方式:

public class PublikoUser : IdentityUser
    {
        [Required]
        public string WebSiteName { get; set; }
    }

public class PublikoIdentityDbContext : IdentityDbContext<PublikoUser>
    {
        public PublikoIdentityDbContext(DbContextOptions<PublikoIdentityDbContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
        } 
    }

非常感谢!

找到解决方案只需要更新 Pages/Shared/_LoginPartial.cshtml 并将 IdentityUser 替换为 PublikoUser,如下所示:

@using Microsoft.AspNetCore.Identity
@using WebApp1.Areas.Identity.Data
@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<PublikoUser> UserManager

<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.4.1/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.1/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.10/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/2.1.0/knockout-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.10/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>