public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
                new { controller = new WcfRoutesConstraint(new string[] {"contact","login"}) }
            );

            var catalog = new AssemblyCatalog(typeof(Global).Assembly);
            var container = new CompositionContainer(catalog);
            var configuration = new ContactManagerConfiguration(container);
            RouteTable.Routes.AddServiceRoute<ContactResource>("contact", configuration);
            RouteTable.Routes.AddServiceRoute<LoginResource>("login", configuration);
        }
Esempio n. 2
0