我写的是我的API控制器
[RoutePrefix("Office")]
public class OfficeController : ApiController
{
[Route("{Admin}/{adminid}")]
public string GetAdminById(int adminid)
{
return string.Format("Enter value is {0}", adminid);
}
[Route("{User}/{userid}")]
public string GetUserByName(int userid)
{
return string.Format("Enter value is {0}", userid);
}
}
我除了帮助生成像
获取Office / Admin / adminid
获取Office / User / userid
但生成的web api帮助位于
之下GET api / Office?adminid = {adminid}
获取api / Office?userid = {userid} ------为什么?
答案 0 :(得分:0)