我想用这个 url 触发下面的路由:
http://localhost:66777/api/productdetails?articlegroup=1&producedat=2012-01-01
我的 - 我猜 - Route 属性有什么问题?
[Route("api/productdetails/{articlegroup:int}/{producedat:datetime}")]
[HttpGet]
public async Task<IHttpActionResult> GetProductDetails([FromUri] ProductDetailsRequestDTO dto)
{
//...
}
public class ProductDetailsRequestDTO
{
public int ArticleGroup { get; set; }
public DateTime ProducedAt { get; set; }
}