In our RouteConfig in an effort to have company profiles names as the some of our root URLs, we are adding a route for each company name, eg. xyz.com/acme
Whilst this appears to be working ok, I was hoping for some general advice on this, or a better way to solve it. I'm particularly concerned about performance, especially as we grow and we may have 10000+ companies and therefore 10000+ routes.
The code looks something like this:
foreach (string companyName in companyNameList)
{
routes.MapRoute(
name: companyName,
url: companyName,
defaults: new { controller = "CompanyProfile", action = "Index" });
}
Any advice would be greatly appreciated?