using System.Web.Mvc;
using System.Web.Routing;
using StubCore.Plugins.Routing;

namespace StubAP
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {

            routes.IgnoreRoute("api/{*pathInfo}");
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });

            /*
             * Front Ajax functions routes
             */
            routes.MapRoute(
                name: "Ajax",
                url: "ajax/{action}",
                defaults: new { controller = "Ajax", action = "" }
            );

            /*
             * Profile controller routes
             */
            routes.MapRoute(
                name: "Profile",
                url: "profile/{action}",
                defaults: new { controller = "Profile", action = "Index", reference = UrlParameter.Optional }
            );//.RouteHandler = new ProfileRouting();

            /*
             * Default routes
             */
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}",
                defaults: new { controller = "Dashboard", action = "Index"}
            );

        }
    }
}