Query string not working while using attribute routing

后端 未结 8 2316
無奈伤痛
無奈伤痛 2020-11-27 12:52

I\'m using System.Web.Http.RouteAttribute and System.Web.Http.RoutePrefixAttribute to enable cleaner URLs for my Web API 2 application. For most of

8条回答
  •  天涯浪人
    2020-11-27 13:34

    I use FromUri attribute as solution

    [Route("UsageAggregationDaily")]
    public async Task UsageAggregationDaily([FromUri] string userId = null, [FromUri] DateTime? startDate = null, [FromUri] DateTime? endDate = null)
    

提交回复
热议问题