public OperationResult Consume(VerificationCodeRequest message) { if (!SagaData.IsPersonalDetailsVerified) { throw new Exception("Person details are not verified. How did you get here?"); } SagaData.VerificationCode = "123456"; SagaData.VerificationCodeSentDate = DateTime.UtcNow; if (message.RequestCarrier == "Mobile") { Console.WriteLine($"sending SMS: Please enter verification code {SagaData.VerificationCode} into the form"); } else { Console.WriteLine($"sending Email: Please enter verification code {SagaData.VerificationCode} into the form"); } return(new OperationResult()); }
private static void RequestVerificationCode(Guid correlationId) { var verificationRequest = new VerificationCodeRequest(correlationId); _sagaMediator.Consume(verificationRequest); }