public override void RegisterArea(AreaRegistrationContext context)
        {
            //context.MapHttpRoute(
            //    c_areaName + "_DefaultActionApi",
            //    AreaName + "/api/nrest/{controller}/{action}/{structureID}/{id}",
            //    new { area = AreaName, id = RouteParameter.Optional });

            //context.MapHttpRoute(
            //    c_areaName + "_DefaultActionApi",
            //    AreaName + "/api/{controller}/{structureID}",
            //    new { area = AreaName });

            context.MapHttpRoute(
                c_areaName + "_DefaultApi",
                AreaName + "/api/{controller}/{id}",
                new { area = AreaName, id = RouteParameter.Optional });

            //context.MapHttpRoute(
            //    c_areaName + "_Api4StructureID",
            //    AreaName + "/api/{controller}/{structureID}/{id}",
            //    new { area = AreaName, id = RouteParameter.Optional });

            context.MapRoute(
                c_areaName + "_Default",
                AreaName + "/{controller}/{action}/{id}",
                new { area = AreaName, action = "Index", id = UrlParameter.Optional });
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapHttpRoute(
                c_areaName + "_DefaultNonRestApi",
                AreaName + "/api/nrest/{controller}/{action}/{ClcID}/{CombiID}/{OutPutType}",
                new { area = AreaName });

            context.MapHttpRoute(
                c_areaName + "_DefaultApi",
                AreaName + "/api/{controller}/{id}",
                new { area = AreaName, id = RouteParameter.Optional });

            context.MapRoute(
                c_areaName + "_Default",
                AreaName + "/{controller}/{action}/{id}",
                new { area = AreaName, action = "Index", id = UrlParameter.Optional });
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapHttpRoute(
                "DefaultApiWithId",
                "Admin/api/{controller}/{id}",
                new { id = RouteParameter.Optional }, new { id = @"\d+" });

            context.MapHttpRoute(
                "DefaultApiWithAction",
                "Admin/api/{controller}/{action}"
                );
            context.MapHttpRoute(
                "DefaultApiWithActionAndId",
                "Admin/api/{controller}/{action}/{id}"
                );
            context.MapHttpRoute(
                "DefaultApiWithController",
                "Admin/api/{controller}"
                );

            /////////////////////////
            //METHOD
            ////////////////////////
            context.MapRoute(
                "Admin_controlPanel",
                "Admin-area/",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "PenDesign.WebUI.Areas.Admin.Controllers" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/",
                new { controller = "Home", action = "Login", id = UrlParameter.Optional },
                namespaces: new[] { "PenDesign.WebUI.Areas.Admin.Controllers" }
            );

            RouteTable.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
            ).RouteHandler = new PenDesign.WebUI.MvcApplication.SessionStateRouteHandler();

            var jsonFormatter = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
            jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapHttpRoute(
                name: "CloudCore.Authentication.ResetPassword",
                routeTemplate: ApiPaths.Application.UserResetPassword,
                defaults: new { area = AreaName, controller = "Authentication", action = "ResetPassword" });

            context.MapHttpRoute(
                name: "CloudCore.Authentication.ChangePassword",
                routeTemplate: ApiPaths.User.ChangePassword,
                defaults: new { area = AreaName, controller = "Authentication", action = "ChangePassword" });

            context.MapHttpRoute(
                name: "CloudCore.Authentication.Login",
                routeTemplate: ApiPaths.Application.UserLogin,
                defaults: new { area = AreaName, controller = "Authentication", action = "Login" });

            context.MapHttpRoute(
                name: "CloudCore.Authentication.Authorize",
                routeTemplate: ApiPaths.Application.Authorize,
                defaults: new { area = AreaName, controller = "Authentication", action = "Authorize" });

            context.MapHttpRoute(
                name: "CloudCore.Authentication.UserDetails",
                routeTemplate: ApiPaths.User.Details,
                defaults: new { area = AreaName, controller = "Authentication", action = "UserDetails" });

            context.MapHttpRoute(
                name: "CloudCore.Authentication.ApplicationDetails",
                routeTemplate: ApiPaths.Application.Details,
                defaults: new { area = AreaName, controller = "Authentication", action = "ApplicationDetails" });

            context.MapHttpRoute(
                name: "CloudCore.Authentication.SingleAuthenticate",
                routeTemplate: ApiPaths.SingleAuthenticate,
                defaults: new { area = AreaName, controller = "Authentication", action = "SingleAuthenticate" });
        }
Beispiel #5
0
 public static Route MapHttpRoute(this AreaRegistrationContext context, string name, string routeTemplate, object defaults)
 {
     return(context.MapHttpRoute(name, routeTemplate, defaults, null));
 }