2017年5月11日

Web API 路由 [二] Attribute Routing

摘要: 1) 启用。在App_Start - WebApiConfig.cs下 2) 使用。Controller中使用Route关键字 3) 与基于约定的路由结合使用。在App_Start - WebApiConfig.cs下 阅读全文

posted @ 2017-05-11 01:09 the_owl 阅读(263) 评论(0) 推荐(0) 编辑

Web API 路由 [一] Convention-Based Routing

摘要: Routing by Naming Convention 在App_Start/ WebApiConfig.cs文件中 步骤: 1) 进行路由匹配,若匹配失败则返回404 2) 找到对应的Controller 3) 找到对应的Action。 原则1:根据HTTP的方法,找以该方法开头的函数。例如,H 阅读全文

posted @ 2017-05-11 00:35 the_owl 阅读(198) 评论(0) 推荐(0) 编辑

导航