예제 #1
0
        public async void GetPosts()
        {
            Posts.Clear();
            var posts = await Firestore.Read();

            foreach (var post in posts)
            {
                Posts.Add(post);
            }
        }
예제 #2
0
        private async void GetPosts()
        {
            //using (SQLiteConnection conn = new SQLiteConnection(App.databaseLocation))
            //{
            //    conn.CreateTable<Post>();
            //    var posts = conn.Table<Post>().ToList();

            //    DisplayOnMap(posts);
            //}

            var posts = await Firestore.Read();

            DisplayOnMap(posts);
        }
예제 #3
0
        public async void GetPosts()
        {
            Categories.Clear();
            var posts = await Firestore.Read();

            PostCount = posts.Count();

            var categories = (from p in posts
                              orderby p.CategoryId
                              select p.CategoryName).Distinct().ToList();

            foreach (var category in categories)
            {
                var count = (from p in posts
                             where p.CategoryName == category
                             select p).ToList().Count;

                Categories.Add(new CategoryCount
                {
                    Name  = category,
                    Count = count
                });
            }
        }