I found a post explain to put
[OperationContract(Name = "GetDataWithNumber")]
public User GetName(int id)
[OperationContract(Name = "GetDataWithString")]
public User GetName(string email)
This wont work if I use Restfull service!
[OperationContract(Name = "GetDataWithNumber")]
[WebGet(UriTemplate = "Service/GetName?id={id}", ResponseFormat = WebMessageFormat.Json)]
public User GetName(int id)
Anyone have solution for this?
I would recommend just using two methods:
This will eliminate the confusion, as well as be more explicit. As the REST service is going to be translating from a text-based representation, the explicit nature is very useful in terms of maintainability.