public async Task <List <GazetteGroup> > FilterByYears(GazetteResult gazette) { List <Models.GazetteGroup> grouped3 = new List <GazetteGroup>(); var result = await All(); var group4 = result.GroupBy(x => new { x.PublicationDate.Year }) .Select(x => new { x.Key.Year, Count = x.Count() }) .OrderByDescending(x => x.Year); foreach (var item in group4) { var yes = new GazetteGroup(item.Year.ToString(), item.Count, new List <GazetteMonths>()); grouped3.Add(yes); } return(grouped3); }
public async Task ItemSelected(GazetteResult gazetteResult) { try { if (gazetteResult != null) { var np = new NavigationParameters { { "gazette", gazetteResult } }; await NavigationService.NavigateAsync("GazettesPage", np); } } catch (Exception ex) { await PageDialogService.DisplayAlertAsync(Dialog.Error, ex.Message, Dialog.Ok); } }