I created this code:
[OperationContract]
[WebGet(UriTemplate = "detect?v=1.0&q={q}", BodyStyle = WebMessageBodyStyle.Bare)]
DetectLanguage GetDetectLanguage(string q);
[OperationContract]
[WebGet(UriTemplate = "translate?v=1.0&q={query}&(langpair={from}|{to})", BodyStyle = WebMessageBodyStyle.Bare)]
TranslateLanguage GetTranslateLanguage(string query, string from, string to);
But I get this error:
The UriTemplate
'translate?v=1.0&q={query}&(langpair={from}|{to})'
is not valid; each portion of the query string must be of the form'name=value'
, when value cannot be a compound segment. See the documentation for UriTemplate for more details.
I know (name=value)
. How do I get Name={value1}|{value2}
? Is it possible?
Or any other solution!