【发布时间】:2019-09-27 11:39:52
【问题描述】:
我已经编写了接受两个参数的 asp.net web.api 方法。当我从邮递员调用该方法时,它不会命中 web 方法。当我定义接受一个参数并用一个参数调用的方法时它工作正常,但当我用两个参数定义它并用两个参数调用时它不调用
[HttpGet]
[Route("api/terms/{id}/{invested}")]
public IHttpActionResult Details(int id, bool invested)
{
var viewModel = GetTermsViewModel(id, invested);
if (viewModel == null) return NotFound();
return Ok(viewModel);
}
【问题讨论】:
-
你使用的两个参数的 URL 是什么?
-
参数为boolean是否有问题
标签: asp.net-web-api