我有这个 REST WCF 服务。
[WebInvoke(UriTemplate = "/GetNames/{Category}?order=asc", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
public List<Names> GetNames(string Category)
{
//Code to retrieve Names by category.
}
Category 参数映射到{Category}
Uri 中。
但是如何将 Uri 中的订单查询字符串映射到这个方法呢?
将订单添加为参数方法不起作用。
请帮忙。提前致谢。