Nested routes not working with new MapServiceRoute method

Topics: Web Api
Apr 22, 2011 at 6:08 PM

Nested routes work great using RouteTable.Routes.Add(), but they're not working with the new RouteTable.Routes.MapServiceRoute() method.

            //Works
            RouteTable.Routes.Add(new ServiceRoute("Api/REST/Public", new WebServiceHostFactory3(), typeof(RESTServicePublic)));
            RouteTable.Routes.Add(new ServiceRoute("Api/REST/Private", new WebServiceHostFactory3(), typeof(RESTServicePrivate)));

            //Doesn't work
            RouteTable.Routes.MapServiceRoute<RESTServicePublic>("Api/REST/Public");
            RouteTable.Routes.MapServiceRoute<RESTServicePrivate>("Api/REST/Private");

            //Doesn't work
            RouteTable.Routes.MapServiceRoute<RESTServicePublic, WebServiceHostFactory3>("Api/REST/Public");
            RouteTable.Routes.MapServiceRoute<RESTServicePrivate, WebServiceHostFactory3>("Api/REST/Private");
Am I just doing something wrong or is this not supported?