public Task <string> ProcessCommand(CancelOrderFlowContext context, IFlowCommand command)
        {
            return(command switch
            {
                SubmitCancelOrderCommand submitCommand => DoProcessing(context, submitCommand),

                _ => throw new UnsupportedCommandException(),
            });
        public Task <string> ProcessCommand(CreateOrderFlowContext context, IFlowCommand command)
        {
            return(command switch
            {
                SubmitPaymentDetailsCommand submitCommand => DoProcessing(context, submitCommand),
                GoToContactDetailsCommand goToContactCommand => DoProcessing(context, goToContactCommand),

                _ => throw new UnsupportedCommandException(),
            });
Ejemplo n.º 3
0
        public Task <string> ProcessCommand(CreateOrderFlowContext context, IFlowCommand command)
        {
            return(command switch
            {
                GoToProductSelectionCommand goToProductSelectionCommand => DoProcessing(context, goToProductSelectionCommand),
                SubmitProductSelectionCommand submitCommand => DoProcessing(context, submitCommand),

                _ => throw new UnsupportedCommandException(),
            });
Ejemplo n.º 4
0
        public async Task ProcessCommand(TFlowContext context, IFlowCommand command)
        {
            context.Reset();

            var stage         = GetFlowState(context);
            var nextStageName = await stage.ProcessCommand(context, command);

            context.SetStage(nextStageName);
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> ProcessCommand(string flowState, IFlowCommand command)
        {
            var context = GetFlowContext(flowState);

            await _flowService.ProcessCommand(context, command);

            if (_actionResult == null)
            {
                throw new EmptyOutputPortException();
            }

            return(_actionResult);
        }