private async Task fetchSectionedTimeEntries() { var groupedEntries = await interactorFactory.GetAllTimeEntriesVisibleToTheUser().Execute() .Select(entries => entries .Where(isNotRunning) .Where(timeEntry => timeEntry.Id != timeEntryToDelete?.Id) .Select(te => new TimeEntryViewModel(te, durationFormat)) ); TimeEntries.ReplaceWith(groupedEntries); }
private async Task fetchSectionedTimeEntries() { var timeEntries = await interactorFactory.GetAllNonDeletedTimeEntries().Execute(); if (timeEntries == null) { TimeEntries.Clear(); return; } var groupedEntries = timeEntries .Where(isNotRunning) .OrderByDescending(te => te.Start) .Select(te => new TimeEntryViewModel(te, durationFormat)) .GroupBy(te => te.StartTime.LocalDateTime.Date) .Select(grouping => new TimeEntryViewModelCollection(grouping.Key, grouping, durationFormat)); TimeEntries.ReplaceWith(groupedEntries); }