我有一个控制器,应该返回同一控制器中其他Action的完整URL。我不知道该怎么做。请看我的示例(使用伪结果):
[Route("api/v{api-version:apiVersion}/Tests")]
[ApiController][AllowAnonymous]
public class TestsController : ControllerBase
{
[HttpGet]
public async Task<IActionResult> GetActions()
{
var idDemo = 1;
//TODO
urls.Add("Get full url for Call method with parameter : idDemo ");
urls.Add("Get full url for Something method with parameter : idDemo ");
return Ok(urls);
}
[HttpPost("call/{id}")]
public async Task<IActionResult> Call(int id)
{
return Ok();
}
[HttpPost("do/it/{id}")]
public async Task<IActionResult> Something(int id)
{
return Ok();
}
}