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

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

问题描述

当我使用.NET Core 2.1时,当我创建具有单独身份验证的新.NET Core Web项目时,将使用 AccountController 和<$创建项目。 c $ c> ManageController 。

While I was using .NET Core 2.1, when I was creating a new .NET Core web project with individual authentication, the project will be created with AccountController and ManageController alongside it.

命令是:


dotnet新mvc --auth个人

dotnet new mvc --auth Individual

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

But, 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开始 strong>身份随ASP.NET Core项目模板作为 Razor类库提供。如果要查看那些与身份相关的代码并进行自定义,则必须脚手架身份在您的项目中。

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.

此外,如果您需要ASP.NET Core身份格式为MVC,那么这是我的GitHub 存储库,其中Razor页面标识已在中转换为MVC ASP.NET Core版本> = 2.2。

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天全站免登陆