我希望所有继承的控制器都AdminBaseApiController以'admin'为前缀.
这当然很好:
[RoutePrefix("admin")]
public class ToggleController : AdminBaseApiController
{
[Route("toggle")]
public HttpResponseMessage Get()
{
}
}
Run Code Online (Sandbox Code Playgroud)
然而,当我移动RoutePrefix("admin")了的ToggleController进入AdminBaseApiController(我想要它) -这条路线失败,我得到一个404.
我看这一切都错了吗?提前致谢!
c# asp.net asp.net-web-api asp.net-web-api-routing asp.net-web-api2