public ViewSpecList Filter(Func <ViewSpec, bool> viewPredicate) { var viewSpecs = ImmutableList.ValueOf(ViewSpecs.Where(viewPredicate)); var viewSpecNames = new HashSet <string>(viewSpecs.Select(viewSpec => viewSpec.Name)); return(new ViewSpecList(viewSpecs, ViewLayouts.Where(layout => viewSpecNames.Contains(layout.ViewName)))); }
public override int GetHashCode() { unchecked { return((ViewSpecs.GetHashCode() * 397) ^ ViewLayouts.GetHashCode()); } }
public ViewSpec GetView(string name) { return(ViewSpecs.FirstOrDefault(viewSpec => viewSpec.Name == name)); }
public ViewSpecList FilterRowSources(ICollection <string> rowSources) { return(new ViewSpecList(ViewSpecs.Where(viewSpec => rowSources.Contains(viewSpec.RowSource)))); }
public ViewSpecList DeleteViews(IEnumerable <string> names) { var nameSet = names as HashSet <string> ?? new HashSet <string>(names); return(new ViewSpecList(ViewSpecs.Where(spec => !nameSet.Contains(spec.Name)))); }