Exemplo n.º 1
0
        public static void Register(HttpConfiguration config)
        {
            UnityApiConfig.RegisterComponents(config);
            config.MessageHandlers.Add(new CancelledTaskBugWorkaroundMessageHandler());
            config.MapHttpAttributeRoutes();
            ConfigureCamelCase(config);
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            config.Routes.MapHttpRoute(
                name: "actionApi",
                routeTemplate: "api/{controller}/{action}/{code}",
                defaults: new { code = RouteParameter.Optional }
                );
        }
Exemplo n.º 2
0
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            UnityApiConfig.RegisterComponents(config);
            ConfigureCamelCase(config);
            config.MapHttpAttributeRoutes();
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            config.Routes.MapHttpRoute(
                name: "actionApi",
                routeTemplate: "api/{controller}/{action}/{code}",
                defaults: new { code = RouteParameter.Optional }
                );
        }