在 .NET Core 2.2 中获取默认的“AccountController" [英] Get the default `AccountController` in .NET Core 2.2

查看:19
本文介绍了在 .NET Core 2.2 中获取默认的“AccountController"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建具有个人身份验证的新 .NET Core 2.1 Web 项目时,该项目将与 AccountControllerManageController 一起创建.

When creating a new .NET Core 2.1 web project with individual authentication, the project will be created with AccountController and ManageController alongside it.

命令是:

dotnet new mvc --auth 个人

dotnet new mvc --auth Individual

但是,我在哪里可以找到 .NET Core 2.2 新项目中默认的 AccountControllerManageController ?我需要修改我的默认登录逻辑.

However, where can I find the default AccountController and ManageController in .NET Core 2.2 new project? I need to modify my default login logic.

推荐答案

默认情况下你不能,因为从 ASP.NET Core 2.1 身份被提供为 Razor 类库使用 ASP.NET Core 项目模板.如果您想查看那些与身份相关的代码并进行自定义,那么您必须 Scaffold Identity 在您的项目中.

By default you cannot because from ASP.NET Core 2.1 Identity is being provided as Razor Class Library with the ASP.NET Core project templates. If you want to see those Identity related codes and customize then you have to Scaffold Identity in your project.

此外,如果您需要 MVC 格式的 ASP.NET Core Identity 那么这里是我的 GitHub Repository 在哪里Razor 页面标识已在 ASP.NET Core 版本 >= 2.2 中转换为 MVC.

Moreover if you need ASP.NET Core Identity in MVC format then here is my GitHub Repository where Razor Page Identity has been converted to MVC in ASP.NET Core Version >= 2.2.

这篇关于在 .NET Core 2.2 中获取默认的“AccountController"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆