private void HandleCreateExperiment(CreateExperiment createExperiment) { Result <Experiment> experimentCreationResult = _repository.CreateExperiment(createExperiment); if (experimentCreationResult.IsFailure) { ExperimentCreationFailed failedExperiment = new ExperimentCreationFailed( experimentCreationResult.Error, createExperiment.LoggedInUserId, createExperiment.SagaId ); _kafkaProducer.Produce(failedExperiment, EXPERIMENT_TOPIC); return; } ExperimentCreated createdExperiment = new ExperimentCreated( experimentCreationResult.Value.Id, experimentCreationResult.Value.Creator, experimentCreationResult.Value.Name, experimentCreationResult.Value.CreationDate, createExperiment.LoggedInUserId, createExperiment.SagaId ); _kafkaProducer.Produce(createdExperiment, EXPERIMENT_TOPIC); }