So for anyone who comes here later, here is how i fixed it.
I created a RouteValueAttribute
as follows
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class RegionAttribute : RouteValueAttribute
{
public RegionAttribute(string regionName) : base("Region", regionName)
{
}
}
Then i can use this similar to how you would specify an area
[Region("Region")]
[Area("Area")]
public class TestController : Controller
{
public IActionResult Index()
{
return View();
}
}
and in startup.cs
app.UseMvc(routes =>
{
routes.MapRoute(
name: "main_route_region",
template: "{region:exists}/{area:exists}/{controller=Home}/{action=Index}/{id?}");
});
Now the action will be accessible from ~/Region/Area/Test/Index