public Task <string> ProcessCommand(CreateOrderFlowContext context, IFlowCommand command) { return(command switch { SubmitContactDetailsCommand submitCommand => DoProcessing(context, submitCommand), GoToProductSelectionCommand selectProductCommand => DoProcessing(context, selectProductCommand), _ => throw new UnsupportedCommandException(), });
public Task <IActionResult> SubmitContactDetails(string flowState, SubmitContactDetailsCommand command) { return(ProcessCommand(flowState, command)); }
public Task <PaymentDetailsViewModel> GetPaymentPage(CreateOrderFlowContext context, SubmitContactDetailsCommand command) { var viewModel = new PaymentDetailsViewModel { FlowContext = context, PaymentMethod = context.PaymentMethod, }; return(Task.FromResult(viewModel)); }
public Task <ContactDetailsViewModel> GetContactDetailsPage(CreateOrderFlowContext context, SubmitContactDetailsCommand command) { var viewModel = new ContactDetailsViewModel { FlowContext = context, Email = command?.Email ?? context.Email, }; return(Task.FromResult(viewModel)); }