routes.MapRoute(
name: "GetAdressen",
url: "{controller}",
defaults: new { controller = "AdressenController", action = "GetAdressen"}
);
routes.MapRoute(
name: "GetEinsaetze",
url: "{controller}",
defaults: new { controller = "EinsaetzeController", action = "GetEinsaetze"}
);
在这种情况下,只有/ Adressen可以使用,而不是/ Einsaetze
routes.MapRoute(
name: "GetEinsaetze",
url: "{controller}",
defaults: new { controller = "EinsaetzeController", action = "GetEinsaetze"}
);
routes.MapRoute(
name: "GetAdressen",
url: "{controller}",
defaults: new { controller = "AdressenController", action = "GetAdressen"}
);
在这种情况下,只有/ Einsaetze可以使用,而不是/ Adressen
为什么?
答案 0 :(得分:0)
像这样使用
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "projectName.Controllers" });