public string DetermineDefaultOneClick() { var defaultOneClick = DefaultOneClick; if (!string.IsNullOrWhiteSpace(defaultOneClick) && ! Searches.Exists( s => s.ID == defaultOneClick || s.Type == defaultOneClick)) { defaultOneClick = null; // it's not there, so it's null } if (defaultOneClick == null) // assign it { defaultOneClick = Searches[0].ID; if (Searches.Count > 1 && defaultOneClick.Contains("AuditLogs")) // don't start with the audit!! { defaultOneClick = Searches[1].ID; } return(defaultOneClick); } return(defaultOneClick); }