public ActionResult <TransactionDto> CreateIncomeTransaction(TransactionForCreationDto transaction)
        {
            var transactionEntity = _mapper.Map <Entities.IncomeTransaction>(transaction);

            _transactionRepository.AddIncomeTransaction(transactionEntity);
            _transactionRepository.Save();

            var transactionToReturn = _mapper.Map <TransactionDto>(transactionEntity);

            return(CreatedAtRoute("GetTransaction", new { transactionId = transactionToReturn.Id }, transactionToReturn));
        }
Beispiel #2
0
        public ActionResult <CategoryDto> CreateIncomeCategory(CategoryForCreationDto category)
        {
            var categoryEntity = _mapper.Map <Entities.IncomeCategory>(category);

            _transactionRepository.AddIncomeCategory(categoryEntity);
            _transactionRepository.Save();

            var categoryToReturn = _mapper.Map <CategoryDto>(categoryEntity);

            return(CreatedAtRoute("GetCategory", new { categoryId = categoryToReturn.Id }, categoryToReturn));
        }