public ResultCommand Handle(UpdateCurrencyTypeCommand command) { var result = new ResultCommand(); var currencyType = _repository.GetById(command.Id); currencyType.Update(command.Name, command.Initials, command.Current, command.CultureInfo); result.AddNotifications(currencyType); if (result.Valid) { _repository.Update(currencyType); } return(result); }
// PUT: api/CurrencyType/5 public HttpResponseMessage Put(Guid id, [FromBody] UpdateCurrencyTypeCommand value) { value.Id = id; return(CreateResponse(_commandHandler.Handle(value))); }