http://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Web.Http/HttpRouteCollectionExtensions.cs

 

 

routes.MapHttpRoute(
    name: "CreateUser",
    routeTemplate: "api/User/{cUser}",
    defaults: new
    {
        controller = "User",
        action = "CreateUser",
        cUser = RouteParameter.Optional
    }
);

routes.MapHttpRoute(
    name: "AllGames",
    routeTemplate: "api/Game/{playerId}",
    defaults: new
    {
        controller = "Game",
        action = "GetAllGames",
        playerId = RouteParameter.Optional
    }
);


config.Routes.MapHttpRoute(
        name: "LegacyUriRedirect",
        routeTemplate: "{*catchall}",
        defaults: new { controller = "URI", action = "LegacyUriRedirect" }
    );

版权声明:本文为zwei1121原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/zwei1121/p/3958203.html