【发布时间】:2012-01-24 16:59:31
【问题描述】:
如何在 WCF Web Api 的 UriTemplate 中声明可选参数? 例如:
[WebGet(UriTemplate = "?culture={culture}")]
HttpResponseMessage<IEnumerable<Contact>> GetAll();
我需要文化作为可选参数。如果文化没有通过,我想收到 null 对于那个参数。
PS。我不想使用具有不同 UriTemplate 的多个 GetAll 方法创建解决方案...
【问题讨论】:
标签: wcf rest wcf-web-api uritemplate webget