private void HandleUpdateExperiment(UpdateExperiment updateExperiment)
        {
            Result <Experiment> updatedExperimentResult = _repository.UpdateExperiment(updateExperiment);

            if (updatedExperimentResult.IsFailure)
            {
                ExperimentUpdateFailed failedExperimentUpdate =
                    new ExperimentUpdateFailed(
                        updatedExperimentResult.Error,
                        updateExperiment.LoggedInUserId,
                        updateExperiment.SagaId
                        );
                _kafkaProducer.Produce(failedExperimentUpdate, EXPERIMENT_TOPIC);
                return;
            }

            ExperimentUpdated updatedExperiment = new ExperimentUpdated(
                updatedExperimentResult.Value.Id,
                updatedExperimentResult.Value.Creator,
                updatedExperimentResult.Value.Name,
                updatedExperimentResult.Value.CreationDate,
                updateExperiment.LoggedInUserId,
                updateExperiment.SagaId
                );

            _kafkaProducer.Produce(updatedExperiment, EXPERIMENT_TOPIC);
        }
Beispiel #2
0
 private void HandleExperimentUpdateFailed(ExperimentUpdateFailed u)
 {
     //todo
 }