public ShortTermExpenseDto(ShortTermExpense expense) { ShortTermExpenseId = expense.EntityId; Name = expense.GetName(); ExecutionDate = expense.GetExecutionDate(); Amount = expense.GetMoney().GetAmount(); Currency = expense.GetMoney().GetCurrency(); }
public async Task <Unit> Handle(UpdateShortTermExpenseCommand command, CancellationToken cancellationToken) { var shortTermExpense = await _repository.GetShortTermExpenseById(command.ShortTermExpenseId); var update = new ShortTermExpense(shortTermExpense.PredictionId, command.Name, command.ExecutionDate, new Money(command.Amount, command.Currency)); shortTermExpense.Update(update); _repository.UpdateShortTermExpense(shortTermExpense); await _repository.SaveAsync(); return(Unit.Value); }
public void UpdateShortTermExpense(ShortTermExpense shortTermExpense) { _db.ShortTermExpenses.Update(shortTermExpense); }