Esempio n. 1
0
        public IEnumerable <DisplayAwardVM> GetModelForHomePage(string query)
        {
            if (string.IsNullOrWhiteSpace(query))
            {
                return(Mapper.Map <IEnumerable <DisplayAwardVM> >(awardBll.GetAllAwards()));
            }

            if (query.Length == 1)
            {
                return(Mapper.Map <IEnumerable <DisplayAwardVM> >(awardBll.GetAwardsByFirstLetter(query[0])));
            }

            return(Mapper.Map <IEnumerable <DisplayAwardVM> >(awardBll.GetAwardsContains(query)));
        }