예제 #1
0
        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());
        }
예제 #2
0
        private static void RequestVerificationCode(Guid correlationId)
        {
            var verificationRequest = new VerificationCodeRequest(correlationId);

            _sagaMediator.Consume(verificationRequest);
        }