예제 #1
0
        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);
        }
예제 #2
0
 public static void Put(Yogurt yogurt)
 {
     string jsonYogurt  = JsonConvert.SerializeObject(yogurt);
     var    apiCallTask = ApiHelper.Put(yogurt.YogurtId, jsonYogurt);
 }