public IActionResult Add([FromBody] TransactionRequest transactionModel) { try { return(Ok(_transactionsService.Add(transactionModel))); } catch (NegativeAmountException ex) { return(BadRequest(ex.Message)); } }
public async Task <Guid> Add(TransactionModel transaction) { var transactionDTO = _mapper.Map <TransactionDTO>(transaction); return(await _transactionService.Add(transactionDTO)); }