Пример #1
0
        public async Task <TResult> Execute(SetContainedViewRequest <TResult> input)
        {
            var ctx = await _contextRepository.CreateSnapshotOfContext(await _contextRepository.Get(input.FlowHandler));

            var newFlowHandler = (await _contextRepository.Get(input.FlowHandler)).NextFlowHandler;

            var flow = await _flows.GetByFlowHandler(newFlowHandler);

            if (flow == null)
            {
                return(await NotFoundResult(input));
            }
            var stepData = await flow.GetCurrentStepData(newFlowHandler,
                                                         stepViewCustomizations : input.ViewCustomizations);

            //update contained step data
            var stepMetaData = stepData.Metadata;

            stepMetaData.ContainedFlowType      = input.NewContainedFlowType;
            stepMetaData.ContainedFlowHandler   = null;
            stepMetaData.ContainedFlowStartType = input.NewContainedFlowStartType;

            await flow.SetCurrentStepData(stepData);

            var result = await input.OnRedirectToCurrent(flow.FlowTypeId, newFlowHandler);

            await _contextRepository.Flush();

            return(result);
        }
Пример #2
0
        private async Task <TResult> NotFoundResult(SetContainedViewRequest <TResult> input)
        {
            var r = new FlowResultResolverRequest <TResult>
            {
                ScreenModel = new UiFlowStepUnauthorized()
            };

            r.CopyCallbacksFrom(input);

            return(await _flowResultResolver.Execute(r));
        }