I am using RestSharp (version 104.4 via NuGet) to make calls to a Rest Web Service. I have designed a set of objects (POCO) which matches resources exposed
You could use following method in the Client side. It is essentially using Newtonsoft deserializer instead of built-in RestSharp deserializer. Newtonsoft deserializer respects DataMember Name property or JsonProperty.
private T Execute(RestRequest request)
{
var response = _client.Execute(request);
if (response.ErrorException != null)
throw new Exception("Error:" + response.ErrorException);
return (T)JsonConvert.DeserializeObject(response.Content, typeof(T));
}