Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas Nilsson 137 posts 260 karma points
    Nov 28, 2014 @ 20:53
    Jonas Nilsson
    0

    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

  • Phill 115 posts 289 karma points
    Nov 29, 2014 @ 00:54
    Phill
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft