Beispiel #1
0
        public virtual void Update(Dictionary <string, object> tokens, string subEndpoint = null, string filepath = null)
        {
            string endpoint = RecordEndpoint + "/" + this["id"].ToString();

            if (subEndpoint != null)
            {
                endpoint += subEndpoint;
            }

            if (filepath == null)
            {
                string body = JsonConvert.SerializeObject(tokens);

                var task = RecordClient.HttpPatchAsync(endpoint, body);
                task.Wait();

                UpdateRecord(task.Result);
            }
            else
            {
                Dictionary <string, string> postFields = new Dictionary <string, string> ();
                foreach (KeyValuePair <string, object> entry in tokens)
                {
                    postFields.Add(entry.Key, entry.Value.ToString());
                }

                var task = RecordClient.HttpPatchFormAsync(endpoint, filepath, postFields);
                task.Wait();

                UpdateRecord(task.Result);
            }
        }
Beispiel #2
0
        public virtual void Update()
        {
            string endpoint = RecordEndpoint + "/" + this["id"].ToString();
            string body     = JsonConvert.SerializeObject(cache);

            var task = RecordClient.HttpPatchAsync(endpoint, body);

            task.Wait();

            UpdateRecord(task.Result);
        }