Пример #1
0
        private async Task fetchSectionedTimeEntries()
        {
            var groupedEntries = await interactorFactory.GetAllNonDeletedTimeEntries().Execute()
                                 .Select(entries => entries
                                         .Where(isNotRunning)
                                         .Select(te => new TimeEntryViewModel(te, durationFormat))
                                         );

            TimeEntries.ReplaceWith(groupedEntries);
        }
Пример #2
0
        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);
        }