How to redirect to action in ASP.NET Core WebAPI?

后端 未结 1 1783
长情又很酷
长情又很酷 2021-01-13 15:54

I\'ve got two actions in my ASP.NET Core Web API application\'s controller:

[HttpGet(\"get-all\")]
public IActionResult GetAll() { ... }

a

相关标签:
1条回答
  • 2021-01-13 16:39

    Have you tried to use RedirectToActionResult? Like this (change ControllerName with your actual Controller's name ):

    RedirectToActionResult("GetAll", "ControllerName", null);
    

    Documentation

    Hope you'll find this useful.

    0 讨论(0)
提交回复
热议问题