Esempio n. 1
0
        public async Task DeleteIncomeAsync(Guid id)
        {
            if (!_incomeRepository.IsIncomeExist(id))
            {
                throw new ServiceExceptions(ServiceErrorCodes.IncomeNotExist,
                                            "Income object not exist");
            }

            var income = await _incomeRepository.GetAsync(id);

            await _incomeRepository.DeleteAsync(income);
        }
        public async Task<bool> DeleteIncomeByIdAsync(int id)
        {

            var review = await _incomeRepository.ListAsync(e => e.Id == id);
            if (review != null)
            { 
                await _incomeRepository.DeleteAsync(review.First());

                return true;

            }

            return false;
          
        }