【问题标题】:Razor pages Identity剃刀页面身份
【发布时间】:2020-05-22 19:36:12
【问题描述】:

我有一个带有身份和 E.F.. 的 Asp.NET Core 3.1 MVC 应用程序。

我正在使用 ApplicationUser 对 IdentityUser 进行个性化设置,我需要更改 Identity Razor 页面中的值,例如页面 Identity/Account/Manage,但该页面不在我的项目中。

我使用命令dotnet aspnet-codegenerator identity -dc MVCCallHub.Data.ApplicationDbContext 生成了支架,但只创建了登录、注册和注销页面。

其他身份页面在哪里?

我的页面结构:

【问题讨论】:

    标签: c# razor asp.net-core-mvc identity


    【解决方案1】:

    如果您查看 Microsoft Docs: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.1&tabs=netcore-cli#scaffold-identity-into-an-mvc-project-with-authorization

    您会看到该命令有一个 --files 参数,您可以通过它选择要构建的文件,这是文档中的示例:

    dotnet aspnet-codegenerator identity -dc MyWeb.Data.ApplicationDbContext --files "Account.Register;Account.Login"
    

    如果您使用--listFiles 运行aspnet-codegenerator,您将看到可以构建的可用文件列表:

    dotnet aspnet-codegenerator identity --listFiles
    

    【讨论】:

      猜你喜欢
      • 2020-02-01
      • 2020-04-30
      • 1970-01-01
      • 2021-11-02
      • 2021-06-28
      • 2020-07-13
      • 2021-08-14
      • 2019-06-21
      • 2020-02-19
      相关资源
      最近更新 更多