I have a controller with an action and I want to set the LocationUri to point to another controller. For example, I have:
[Route("auth")]
[ApiController]
public class AuthorisationController
{
[Route("{id}")]
public IActionResult Put([FromRoute]string id, [FromBody]FooBar request)
{
return new CreatedResult("locationUri", SanitiseResponse(request));
}
}
I want the LocationUri to point to this controller
[Route("transaction")]
[ApiController]
public class TransactionController
{
[Route("{id}")]
public IActionResult Get([FromRoute] string id)
{
return new OkResult();
}
}
Any ideas how I do this? I was constructing it myself using _httpContextAccessor but wondered if there was a better way?