private void SetItemFilterAndNavigateNext(CommandButtonDescriptor button)
        {
            using (IScopedFlowManagerService flowManagerService = App.ServiceProvider.GetRequiredService <IScopedFlowManagerService>())
            {
                flowManagerService.CopyFlowItems();

                flowManagerService.SetFlowDataCacheItem
                (
                    typeof(FilterLambdaOperatorParameters).FullName,
                    this.getItemFilterBuilder.CreateFilter
                    (
                        this.FormSettings.ItemFilterGroup,
                        typeof(TModel),
                        this.entity
                    )
                );

                flowManagerService.Next
                (
                    new CommandButtonRequest
                {
                    NewSelection = button.ShortString
                }
                );
            }
        }
Beispiel #2
0
        public void DataFromTheSameScopeMustMatch()
        {
            IScopedFlowManagerService scopedFlowManagerService1 = serviceProvider.GetRequiredService <IScopedFlowManagerService>();

            scopedFlowManagerService1.SetFlowDataCacheItem("A", new List <string> {
                "First", "Second"
            });
            object aList = scopedFlowManagerService1.GetFlowDataCacheItem("A");

            Assert.Equal("Second", ((List <string>)aList)[1]);
        }
Beispiel #3
0
        public void DataFromDifferentScopesCanBeDifferent()
        {
            IScopedFlowManagerService scopedFlowManagerService1 = serviceProvider.GetRequiredService <IScopedFlowManagerService>();
            IScopedFlowManagerService scopedFlowManagerService2 = serviceProvider.GetRequiredService <IScopedFlowManagerService>();

            scopedFlowManagerService1.SetFlowDataCacheItem("A", new List <string> {
                "First", "Second"
            });

            Assert.Empty(scopedFlowManagerService2.FlowManager.FlowDataCache.Items);
            Assert.Equal("Second", ((List <string>)scopedFlowManagerService1.FlowManager.FlowDataCache.Items["A"])[1]);
        }