public NCMBObject Save() { NCMBRequest r = new NCMBRequest(_ncmb); var response = _fields.ContainsKey("objectId") ? r.Put(Name, (string)_fields.GetValue("objectId"), GetData()) : r.Post(Name, GetData()); Sets(response); return(this); }
private NCMBRequest GetLoginRequest() { NCMBRequest r = new NCMBRequest(); r.Name = Name; r.Queries = GetData(); r.Method = "GET"; r.Path = "login"; return(r); }
public async Task <bool> Delete() { NCMBRequest r = new NCMBRequest(); r.Method = "DELETE"; r.Name = Name; r.ObjectId = ObjectId(); var response = await r.Exec(); return(response.Count == 0); }
public async Task <bool> Fetch() { NCMBRequest r = new NCMBRequest(); r.Method = "GET"; r.Name = Name; r.ObjectId = ObjectId(); var response = await r.Exec(); Sets(response); return(true); }
new async public Task <bool> Save() { NCMBRequest r = new NCMBRequest(); r.Name = Name; r.Method = "POST"; r.Data = data; r.Fields = GetData(); r.MimeType = MimeType; r.ObjectId = GetString("fileName"); var response = await r.Exec(); Sets(response); return(true); }
public NCMBRequest GetRequest() { NCMBRequest r = new NCMBRequest(); r.Name = Name; r.Fields = GetData(); // Console.WriteLine(_fields); if (_fields.ContainsKey("objectId")) { r.Method = "PUT"; r.ObjectId = ObjectId(); } else { r.Method = "POST"; } return(r); }
public NCMBObject[] Find() { var queries = new JObject(); if (where.Count > 0) { queries.Add("where", where); } var r = new NCMBRequest(_ncmb); var results = r.Get(Name, queries); var ary = (JArray)results.GetValue("results"); var count = ary.Count; var objs = new NCMBObject[count]; var i = 0; foreach (var row in ary) { var obj = _ncmb.Object(Name); obj.Sets((JObject)row); objs[i] = obj; i++; } return(objs); }
private NCMBRequest GetClient() { var queries = new JObject(); if (where.Count > 0) { queries.Add("where", where); } if (_limit > 0) { queries.Add("limit", _limit); } if (!(_order is null)) { queries.Add("order", _order); } if (!(_include is null)) { queries.Add("include", _include); } if (_skip > 0) { queries.Add("skip", _skip); } if (_count) { queries.Add("count", 1); } var r = new NCMBRequest(); r.Name = Name; r.Queries = queries; r.Method = "GET"; return(r); }
public bool Delete() { NCMBRequest r = new NCMBRequest(_ncmb); return(r.Delete(Name, (string)_fields.GetValue("objectId"))); }