Beispiel #1
0
        public ActionResult Index()
        {
            var gifts = _giftService.GetPolular(CustomConstants.PopularGiftsCount).ToList();
            var model = Mapper.Map <IEnumerable <GiftViewModel> >(gifts);

            model.ForEach(x => x.About =
                              x.About.Length < CustomConstants.AboutGiftsLettersCount ?
                              x.About :
                              x.About.Substring(0, CustomConstants.AboutGiftsLettersCount) + CustomConstants.Dots);

            return(View(model));
        }