【发布时间】:2015-08-26 15:06:24
【问题描述】:
假设我在 WCF 中有一个 REST 操作合同,看起来像这样:
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "getXYZ/?LastName={LastName}&BirthDate={BirthDate}&ZipCode={ZipCode}&Year={Year}")]
但是由于误解,有些人将“年份”传递为“出生年份”,并想知道为什么会出错。有什么办法可以适应这种情况并告诉 WCF 将“BirthYear”视为“Year”而不会有太多麻烦?
【问题讨论】:
标签: .net web-services wcf rest