Esempio n. 1
0
        static T Post <T>(BikeRegResource resource, object body)
        {
            var request         = new RestRequest(resource.ToString(), Method.POST).AddJsonBody(body);
            var content         = new RestClient(BaseURL).Execute(request).Content;
            var serializedValue = JsonConvert.DeserializeObject <JObject>(content).Property(resource.Header()).Value.ToString();

            return(JsonConvert.DeserializeObject <T>(serializedValue));
        }
Esempio n. 2
0
 static string Header(this BikeRegResource resource) =>
 resource == BikeRegResource.PromoterLogin ? "PromoterLoginResult" : "Get" + resource.ToString() + "Result";