Hello - I'd like to return a Customer object from a WCF REST method based on customer ID. For example: http://localhost/RestTest.svc/Customers/123
I can successfully use the following OperationContract to do this:
[OperationContract]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "Customers/{id}")]
Customer GetCustomer(string id);
I'd rather use an int id parameter instead of string id parameter but I think this may be a constraint of WCF REST services.
Am I stuck with a string id parameter or is there a workaround that will let me define the id parameter as an int?