public void Update(UpdateHistoryEquipmentCommand command) { this.IdVideo = command.IdVideo; this.IdEquipment = command.IdEquipment; this.DateOfRegister = command.DateOfRegister; this.Action = command.Action; this.Value = command.Value; }
public HistoryEquipment Update(UpdateHistoryEquipmentCommand command) { var history = _repository.GetById(command.IdHistoryEquipment); history.Update(command); _repository.Update(history); if (Commit()) { return(history); } return(null); }
public Task <HttpResponseMessage> Put(int id, [FromBody] dynamic body) { var command = new UpdateHistoryEquipmentCommand( idHistoryEquipment: id, idVideo: (int)body.idVideo, idEquipment: (int)body.idEquipment, value: (decimal)body.value, idCompany: (int)body.idCompany, plan: (string)body.plan ); var history = _service.Update(command); return(CreateResponse(HttpStatusCode.OK, history)); }