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 } ); } }
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]); }
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]); }