public Either <MeasurementError, MeasurementDto> Update(MeasurementCreateCommand command)
 {
     return(TracedOperation.CallSync
            (
                _logger,
                MeasurementOperationType.UpdateMeasurement,
                command,
                // TODO refactor
                () =>
     {
         if (_repository.ExistsByExternalId(command.ExternalId))
         {
             _repository.DeleteByExternalId(command.ExternalId);
         }
         return Create(command);
     }
            ));
 }