Example #1
0
        public async Task <List <Category> > FetchAllMeditationCategory()
        {
            var meditationService = new MeditationService();

            MeditationModel[] allMeditation = await meditationService.fetchAllMeditationAsync();

            if (allMeditation != null && allMeditation.Length > 0)  // extract unique meditation categories from all meditattion list
            {
                List <Category> list = AppUtils.CategoryUtil.GetCount(allMeditation);
                return(list);
            }
            else
            {
                Debug.WriteLine("Meditation list in Category page in empty");
                return(null);
            }
        }
Example #2
0
        public async Task <List <MeditationModel> > FetchAllMeditationCategoryItems()
        {
            var meditationService = new MeditationService();

            MeditationModel[] allMeditation = await meditationService.fetchAllMeditationAsync();

            if (allMeditation != null && allMeditation.Length > 0) // extrect med items bases on selected category
            {
                List <MeditationModel> medBasesOnSelectedMedCategory = allMeditation.Where(g => g.category == selectedCategoryType).ToList();
                return(medBasesOnSelectedMedCategory);
            }
            else
            {
                Debug.WriteLine("Meditation list in Category item page in empty");
                return(null);
            }
        }