gpt4 book ai didi

asp.net-core - 如何通过 dotnet 将所有身份文件搭建到 ASP.NET Core 2.1 MVC 项目中?

转载 作者:行者123 更新时间:2023-12-01 16:59:20 26 4
gpt4 key购买 nike

在题为 Scaffold Identity in ASP.NET Core projects 的 MSDN 文章中 有一组专门针对 "creating full identity UI source" 的说明(而不是使用 Razor Class Library for identity )。

本节开头为:

To maintain full control of the Identity UI, run the Identity scaffolder and select Override all files.

没有给出可以在 shell 中运行来构建所有这些文件的命令,因此我假设“覆盖所有文件”是 Visual Studio 中的 UI 控件。

如果我们查看 dotnet aspnet-codegenerator Identity -h 的输出,我们将看不到任何生成所有文件的选项。

Usage: aspnet-codegenerator [arguments] [options]

Arguments:
generator Name of the generator. Check available generators below.

Options:
-p|--project Path to .csproj file in the project.
-n|--nuget-package-dir
-c|--configuration Configuration for the project (Possible values: Debug/ Release)
-tfm|--target-framework Target Framework to use. (Short folder name of the tfm. eg. net46)
-b|--build-base-path
--no-build

Selected Code Generator: identity

Generator Options:
--dbContext|-dc : Name of the DbContext to use, or generate (if it does not exist).
--files|-fi : List of semicolon separated files to scaffold. Use the --list-files option to see the available options.
--listFiles|-lf : Lists the files that can be scaffolded by using the '--files' option.
--userClass|-u : Name of the User class to generate.
--useSqLite|-sqlite : Flag to specify if DbContext should use SQLite instead of SQL Server.
--force|-f : Use this option to overwrite existing files.
--useDefaultUI|-udui : Use this option to setup identity and to use Default UI.
--layout|-l : Specify a custom layout file to use.
--generateLayout|-gl : Use this option to generate a new _Layout.cshtml

考虑到所有这些,dotnet 命令行脚手架工具的用户如何生成属于身份生成器的所有文件?

最佳答案

如果省略 --files--useDefaultUI 标志,它将生成所有文件。

$ dotnet aspnet-codegenerator identity

根据 docs :

If you run the Identity scaffolder without specifying the --files flag or the --useDefaultUI flag, all the available Identity UI pages will be created in your project.

<小时/>

来源:

https://github.com/aspnet/Docs/pull/8752

关于asp.net-core - 如何通过 dotnet 将所有身份文件搭建到 ASP.NET Core 2.1 MVC 项目中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52223806/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com