Example #1
0
        // GET: /Ads/
        public ActionResult Index()
        {
            //TODO : Does this method have to return a list?
            var sources = _service.GetAllAdsList();
            var ads     = Mapper.Map <Ad[], AdViewModel[]>(sources);

            return(View(ads));
        }
Example #2
0
        public static IEnumerable <SelectListItem> GetAllAds()
        {
            var ads = _service.GetAllAdsList();

            return(ads.Select(x => new SelectListItem {
                Text = x.Title + ":" + x.Version, Value = x.ID.ToString()
            }));
        }