Ejemplo n.º 1
0
        public async Task <List <Posts> > GetAllPosts()
        {
            var query  = ParseObject.GetQuery("Post");
            var result = await query.FindAsync();

            var PostList = new List <Posts> ();

            foreach (var obj in result)
            {
                Posts tempobj = new Posts();

                tempobj.ObjectId  = obj.ObjectId;
                tempobj.CreatedAt = obj.CreatedAt;
                tempobj.UpdatedAt = obj.UpdatedAt;

                ParseUser usrobj = obj.Get <ParseUser> ("User");
                tempobj.ParseUser = await usrobj.FetchIfNeededAsync();

                tempobj.Image       = obj.Get <ParseFile> ("Image");
                tempobj.Description = Convert.ToString(obj ["Description"]);

                PostList.Add(tempobj);
            }

            return(PostList);
        }
Ejemplo n.º 2
0
        public async Task <List <Collection> > GetAllCollections()
        {
            var query  = ParseObject.GetQuery("Collection").WhereEqualTo("owner", ParseUser.CurrentUser);
            var result = await query.FindAsync();

            CollectionList = new List <Collection>();

            foreach (var obj in result)
            {
                Collection tempobj = new Collection();

                tempobj.ObjectId  = obj.ObjectId;
                tempobj.CreatedAt = obj.CreatedAt;
                tempobj.UpdatedAt = obj.UpdatedAt;

                ParseUser usrobj = obj.Get <ParseUser>("owner");
                tempobj.Owner = await usrobj.FetchIfNeededAsync();

                //tempobj.Image = obj.Get<ParseFile>("image");
                tempobj.Name = Convert.ToString(obj["name"]);

                CollectionList.Add(tempobj);
            }

            return(CollectionList);
        }
Ejemplo n.º 3
0
        public async Task FetchObjects()
        {
            await submitter.FetchIfNeededAsync();

            await room.FetchIfNeededAsync();

            await blurbObjects.FetchAllIfNeededAsync();

            foreach (ParseObject blurbObject in blurbObjects)
            {
                this.blurbs.Add(new Blurb(blurbObject));
            }
        }
Ejemplo n.º 4
0
        public async Task <List <CollectionItems> > GetItems()
        {
            var query  = ParseObject.GetQuery("Item").WhereEqualTo("collection", ParseObject.CreateWithoutData("Collection", collectionID));
            var result = await query.FindAsync();

            ItemList = new List <CollectionItems>();

            foreach (var obj in result)
            {
                CollectionItems tempobj = new CollectionItems();

                tempobj.ObjectId  = obj.ObjectId;
                tempobj.CreatedAt = obj.CreatedAt;
                tempobj.UpdatedAt = obj.UpdatedAt;

                ParseUser usrobj = obj.Get <ParseUser>("owner");
                tempobj.Owner = await usrobj.FetchIfNeededAsync();

                tempobj.Name = Convert.ToString(obj["name"]);

                if (obj["description"] != null)
                {
                    tempobj.Description = Convert.ToString(obj["description"]);
                }
                else
                {
                    tempobj.Description = "";
                }
                if (obj["website"] != null)
                {
                    tempobj.Website = Convert.ToString(obj["website"]);
                }
                else
                {
                    tempobj.Website = "";
                }


                ItemList.Add(tempobj);
            }

            return(ItemList);
        }