我想要这样的访问资源:
/api/adddevice/12345
这条路线有什么不正确的?
routes.MapRoute(
name: "AddDevice",
url: "adddevice/{id}",
defaults: new { controller = "some controller", action = "adddevice", id = UrlParameter.Optional }
);
public string AddDevice(int id)
{
return "Device " + id.ToString() + " succesfully added";
}
编辑
以下是错误详情:
<MessageDetail>
No type was found that matches the controller named 'some controller'.
</MessageDetail>