public bool UpdateMeasurement(MeasurementUpdateRequest request) { return(_measurementRepository.UpdateMeasurement(new Measurement { Id = request.Id, MeasurementPointId = request.MeasurementPointId, ShopId = request.ShopId, VehicleId = request.VehicleId, Date = request.Date, Flush = request.Flush, Gap = request.Gap })); }
public IActionResult Create([FromBody] MeasurementRequest request) { CreateMeasures(request.Measurements); foreach (var reqMeasurement in request.Measurements) { var measurement = new Measurement { UserId = CurrentUserId, MeasureId = reqMeasurement.MeasureId.Value, Time = request.Time, Value = reqMeasurement.Value }; if (reqMeasurement.MeasurementId.HasValue) { measurement.Id = reqMeasurement.MeasurementId.Value; measurementRepository.UpdateMeasurement(measurement); } else { measurementRepository.CreateMeasurement(measurement); } } return(Ok()); }
public void UpdateMeasurement(string userId, MeasurementDto measurementDto) { _repository.UpdateMeasurement(userId, measurementDto); }