I am looking for a way to grammatically change the value of Route attribute.
I have a scenario where the api route should be either :
[Route("api/v1/[Controller]")]or[Route("api/xyz/v1/[Controller]")]
based on whether I am running it in debug mode or not.
[Route("api/v1/[Controller]")]
[ApiController]
public class MyController : BaseController
{
}
I tried adding a variable in Base Controller but realized that I can't access it in Route attribute.