Esempio n. 1
0
        // Logical operations
        public static CloudQuery Or(CloudQuery query1, CloudQuery query2)
        {
            if (query1.dictionary["tableName"].ToString()!= query2.dictionary["tableName"].ToString())
            {
                throw new Exception.CloudBoostException("Tablename of two query objects are not the same.");
            }

            var query = new CloudQuery((string)query1.dictionary["tableName"]);
            ArrayList list = new ArrayList();
            list.Add(query1);
            list.Add(query2);
            ((Dictionary<string, Object>)(query.dictionary["query"]))["$or"] = list;

            return query;
        }
Esempio n. 2
0
        // Logical operations
        public static CloudQuery Or(CloudQuery query1, CloudQuery query2)
        {
            if (query1.dictionary["tableName"].ToString() != query2.dictionary["tableName"].ToString())
            {
                throw new Exception.CloudBoostException("Tablename of two query objects are not the same.");
            }

            var       query = new CloudQuery((string)query1.dictionary["tableName"]);
            ArrayList list  = new ArrayList();

            list.Add(query1);
            list.Add(query2);
            ((Dictionary <string, Object>)(query.dictionary["query"]))["$or"] = list;

            return(query);
        }
Esempio n. 3
0
        public async Task <CloudObject> FetchAsync()
        {
            if (dictionary["_id"] == null)
            {
                throw new Exception.CloudBoostException("Can't fetch an object which is not saved");
            }

            var query = new CloudQuery(dictionary["_tableName"].ToString());

            if (dictionary["_type"].ToString() == "file")
            {
                query = new CloudQuery("_File");
            }

            CB.CloudObject obj = await query.GetAsync <CloudObject>(dictionary["_id"].ToString());

            return(obj);
        }