public static Yogurt GetDetails(int id) { var apiCallTask = ApiHelper.Get(id); var result = apiCallTask.Result; JObject jsonResponse = JsonConvert.DeserializeObject <JObject>(result); Yogurt yogurt = JsonConvert.DeserializeObject <Yogurt>(jsonResponse.ToString()); return(yogurt); }
public static void Put(Yogurt yogurt) { string jsonYogurt = JsonConvert.SerializeObject(yogurt); var apiCallTask = ApiHelper.Put(yogurt.YogurtId, jsonYogurt); }