public PaymentToCompany Update(UpdatePaymentToCompanyCommand command) { var payment = _repository.GetById(command.IdPaymentToCompany); payment.Update(command); _repository.Update(payment); if (Commit()) { return(payment); } return(null); }
public Task <HttpResponseMessage> Put(int id, [FromBody] dynamic body) { var command = new UpdatePaymentToCompanyCommand( idPaymentToCompany: id, idCompany: (int)body.idCompany, value: (decimal)body.value, datePayment: (DateTime)body.datePayment, description: (string)body.description ); var payment = _service.Update(command); return(CreateResponse(HttpStatusCode.OK, payment)); }
public void Update(UpdatePaymentToCompanyCommand command) { this.DatePayment = command.DatePayment; this.Description = command.Description; this.Value = command.Value; }