ASP.Net Core 中写了Action方法 但是运行路由找不到是为什么?

ASP.Net Core 中写了Action方法 但是运行路由找不到是为什么?

public IActionResult Index()
{

        return View();
    }

    [HttpPost]   
    public  IActionResult DoLogin(Admin admin)
    {

        //先验证
        if (ModelState.IsValid)
        {
            Admin user =   _adminRepository.GetEntityAsync(c=>c.username == admin.username).Result;


            if (user != null)
            {
                if(user.pass == admin.pass)
                {

                }
            }

        }

        return View();
    }

报错:
找不到与以下网址对应的网页:https://localhost:44322/Login/DoLogin

我的管道中间件设的也是对的

app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Login}/{action=Index}/{id?}");
});

求同学们指点

您好,你这个DoLogin方法是个post方法,没办法在地址栏请求这个路由的,只能通过表单提交或者ajax请求才可以。