我有一个MVC应用程序,无法完全获得适用于我的多租户应用程序的路由。这里是问题:多租户应用程序的MVC路线
我在我的应用程序中有2种类型的页面,大多数需要租户名称在url中,但有些不。例如
这些干什么(承租人的名字是这些例子是三星和苹果):
http://www.mytestapp.com/samsung/customers/add
http://www.mytestapp.com/apple/customers/add
这些不:
http://www.mytestapp.com/home/register/
http://www.mytestapp.com/home/aboutus/
我需要哪些路线才能使其工作?我已经尝试过,但它不适用于注册表和关于我们的页面。
routes.MapRoute(
name: "TenantRoute",
url: "{tenantid}/{controller}/{action}/{id}",
defaults: new { tenantid = "tenantname", controller = "Home", action = "Index", id = UrlParameter.Optional }
);