Пример #1
0
        public void CalculateResults()
        {
            Years.Clear();

            var expenses = _expenseRepository.Load();

            var expensesPerYear   = expenses.GroupBy(e => e.Date.Year);
            var yearPresentations = expensesPerYear
                                    .Select(yearExpense => new YearResultsPresentation(yearExpense.Key, yearExpense.ToArray(), _categorizer));

            Years.AddRange(yearPresentations);
        }