How to replace MVC HomeController/Index redirects with RazorPages routings?
问题 I'm migrating from ASP MVC Classic to ASP Razor Pages. Only one controller left to "migrate": HomeController public class HomeController : Controller { UserManager<WebUser> _userManager; public HomeController(UserManager<WebUser> _userManager) { this._userManager = _userManager; } [Authorize] public async Task<IActionResult> Index() { var user = await _userManager.GetUserAsync(User); if (user == null) { return RedirectToPage("/Account/Login", new { area = "WebUserIdentity" }); } return