MapHttpRoute

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" }
);
上一篇:[LintCode] Valid Palindrome 验证回文字符串


下一篇:idl 批量裁剪代码