public async Task <IEnumerable <Entities.Income> > GetAllAsync()
        {
            var x = await _incomeRepository.GetAllAsync();

            var orderByIds = x.OrderBy(o => o.Id).ToList();

            return(orderByIds);
        }
Esempio n. 2
0
        public async Task <IEnumerable <Income> > GetAllIncomesAsync(IncomeRequestDTO request)
        {
            var incomes = (await incomeRepository.GetAllAsync(request.DateFilter));

            if (request.SourceId.HasValue)
            {
                incomes = incomes.Where(x => request.IsSecondCat ? x.SecondSourceId == request.SourceId.Value : x.SourceId == request.SourceId.Value);
            }

            return(incomes.OrderByDescending(x => x.Date).ThenBy(x => x.Source));
        }