RouteConfig.cs 768 B

123456789101112131415161718192021222324252627
  1. using System.Web.Http;
  2. using System.Web.Mvc;
  3. using System.Web.Routing;
  4. namespace WePlatform
  5. {
  6. public class RouteConfig
  7. {
  8. public static void RegisterRoutes(RouteCollection routes)
  9. {
  10. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  11. //ASP.NET Web API Route Config
  12. routes.MapHttpRoute(
  13. name: "DefaultApi",
  14. routeTemplate: "api/{controller}/{id}",
  15. defaults: new { id = RouteParameter.Optional }
  16. );
  17. routes.MapRoute(
  18. name: "Default",
  19. url: "{controller}/{action}/{id}",
  20. defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  21. );
  22. }
  23. }
  24. }