public ShortTermIncomeDto(ShortTermIncome income) { Check.NotNull(income, nameof(income)); ShortTermIncomeId = income.EntityId; Name = income.GetName(); ExecutionDate = income.GetExecutionDate(); Amount = income.GetMoney().GetAmount(); Currency = income.GetMoney().GetCurrency(); }
public async Task <Unit> Handle(UpdateShortTermIncomeCommand command, CancellationToken cancellationToken) { var shortTermIncome = await _repository.GetShortTermIncomeById(command.ShortTermIncomeId); var update = new ShortTermIncome(shortTermIncome.PredictionId, command.Name, command.ExecutionDate, new Money(command.Amount, command.Currency)) { EntityId = command.ShortTermIncomeId }; shortTermIncome.Update(update); _repository.UpdateShortTermIncome(shortTermIncome); await _repository.SaveAsync(); return(Unit.Value); }
public void UpdateShortTermIncome(ShortTermIncome income) { _db.Update(income); }