how to merge all routing paths in one Route attribute in asp.net core 5

Viewed 81

I am working on net core 5 project and I am trying to create an API's wit dynamic URL path's so I started with using Route Attribute like the following

[Route("customPath")]
[Rout("anotherCustomPath")]
public IEnumerable<string> Get()
{
   return new string[] { "value1", "value2"};
}

My question is how can I mix the two Route attributes in one attribute to be something like

[Route("customPath,anotherCustomPath")] 

and to get custom paths values from a dynamic string ?

0 Answers
Related