public async void GetPosts() { Posts.Clear(); var posts = await Firestore.Read(); foreach (var post in posts) { Posts.Add(post); } }
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); }
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 }); } }