Beispiel #1
0
        public void RegisterRoutes(System.Web.Routing.RouteCollection routes)
        {
            ViewEngines.Engines.Insert(0, new CustomViewEngine());

            var route = routes.MapRoute("Plugin.Dreamy.Menu.Topic", "Admin/Topic/List",
                                        new { controller = "Topic", action = "List" }, new[] { "Nop.Plugin.Dreamy.Menu.Controllers" });

            routes.Remove(route);
            routes.Insert(0, route);
        }
        private static void MapFirst(System.Web.Routing.RouteCollection routes, string name, string path, object defaults, string[] namespaces, object constraints = null)
        {
            var route = routes.MapRoute(name, path, defaults);

            if (constraints != null)
            {
                route.Constraints = new System.Web.Routing.RouteValueDictionary(constraints);
            }

            routes.Remove(route);
            routes.Insert(0, route);
        }