I'm using Umbraco 7.1.8 and a custom web api route.
public static class AppStart { public static void PreStart() { RouteTable.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = System.Web.Http.RouteParameter.Optional } ); } }
But this causes the Umbraco backend to crach with this error
Multiple actions were found that match the request: System.Collections.Generic.IEnumerable`1[Umbraco.Web.Search.ExamineIndexerModel] GetIndexerDetails() on type Umbraco.Web.WebServices.ExamineManagementApiController System.Collections.Generic.IEnumerable`1[Umbraco.Web.Search.ExamineSearcherModel] GetSearcherDetails() on type Umbraco.Web.WebServices.ExamineManagementApiController
I have tried a few different ways to ad namespace constraints, but with no luck. Any working solution for this?
I have gone down this path before trying to add support for /gallery/photos or /brand/productlist or /product/detail and the end result was I always ended up going the iContent finder which allowed me to break down the url parts, see if they matched my specific keys like "product" and then I'd pass that data to the view similar to a query param so I could get the specific data.
If you think that's what you're trying to do then do a search for iContentFinder, there are a number of examples already. If you can't find anything post back and I'll dig up sample I have. This is the blog post that helped me a lot: http://www.steadygo.co.uk/umbraco-7-creating-dynamic-url-handler/ ;
Multipe actions with custom routing
I'm using Umbraco 7.1.8 and a custom web api route.
public static class AppStart
{
public static void PreStart()
{
RouteTable.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = System.Web.Http.RouteParameter.Optional }
);
}
}
But this causes the Umbraco backend to crach with this error
Multiple actions were found that match the request: System.Collections.Generic.IEnumerable`1[Umbraco.Web.Search.ExamineIndexerModel] GetIndexerDetails() on type Umbraco.Web.WebServices.ExamineManagementApiController System.Collections.Generic.IEnumerable`1[Umbraco.Web.Search.ExamineSearcherModel] GetSearcherDetails() on type Umbraco.Web.WebServices.ExamineManagementApiController
I have tried a few different ways to ad namespace constraints, but with no luck.
Any working solution for this?
/Jonas
I have gone down this path before trying to add support for /gallery/photos or /brand/productlist or /product/detail and the end result was I always ended up going the iContent finder which allowed me to break down the url parts, see if they matched my specific keys like "product" and then I'd pass that data to the view similar to a query param so I could get the specific data.
If you think that's what you're trying to do then do a search for iContentFinder, there are a number of examples already. If you can't find anything post back and I'll dig up sample I have. This is the blog post that helped me a lot: http://www.steadygo.co.uk/umbraco-7-creating-dynamic-url-handler/ ;
Phill
is working on a reply...