internal void SetSortingAlgorithmForTab(string name, string option, Tab SelectedTab) { SortingAlgorithmInfo s = SortingAlgorithmInfos.FirstOrDefault(x => x.League == SelectedTab.League.Name && x.TabIndex == SelectedTab.Index); if (s == null) { s = new SortingAlgorithmInfo() { League = SelectedTab.League.Name, TabIndex = SelectedTab.Index }; SortingAlgorithmInfos.Add(s); } s.Name = name; s.Option = option; SaveChanges(); }