public FilterState?RedirectFilter(string name) { if (!FilterSet.ContainsKey(name)) { return(null); } if (Redirects.Contains(name)) { return(null); // Recursion in filters! } Redirects.Add(name); var newFilterDef = FilterSet[name]; if (newFilterDef is null) { return(null); } return(new FilterState { Type = newFilterDef.MappingType, SourcePath = newFilterDef.DataPath, OriginalPath = OriginalPath, Params = newFilterDef.MappingParameters, RepeaterData = RepeaterData, Data = Data, FilterSet = FilterSet, Redirects = Redirects, RunningTotals = RunningTotals }); }