zwei1121

博客园 首页 新随笔 联系 订阅 管理

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" }
    );
posted on 2014-09-05 15:41  zwei  阅读(1857)  评论(0编辑  收藏  举报