public async Task <IEnumerable <ISearchResult> > SearchTeams(string searchText, DateTime viewDate)
        {
            var teamGroups = await TeamNames
                             .Where(w => w.Description.Contains(searchText.Trim()) && w.TeamV.IsActive)
                             .Select(s => s.TeamV)
                             .GroupBy(g => g.HeaderKey).ToListAsync();

            var teamVs = new List <TeamV>();

            foreach (var teamGroup in teamGroups)
            {
                teamVs.Add(teamGroup.OrderByDescending(t => t.EffectiveFrom).First());
            }

            return(teamVs.ToViewModels(viewDate).Cast <ISearchResult>());
        }
        public async Task <IEnumerable <string> > GetTeamAutoCompleteList(Guid userId, bool isAdmin, string searchText)
        {
            var teams = await TeamNames.Where(w => w.Description.Contains(searchText.Trim()) && w.TeamV.IsActive).ToListAsync();

            return(teams.Select(s => s.Description).Distinct().OrderBy(o => o));
        }