public async Task <IActionResult> Delete(int id) { Spending spending = await spendingRepository.Get(id).ConfigureAwait(true); spendingRepository.Remove(spending); await unitOfWork.CompleteAsync().ConfigureAwait(true); return(Ok(mapper.Map <SpendingForGetDTO>(spending))); }
public bool Remove(SpendingRemoveCommand cmd) { Spending spendingDb = _repositorySpending.GetById(cmd.Id) ?? throw new NotFoundException(); return(_repositorySpending.Remove(spendingDb)); }