// 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)); }
public static IEnumerable <SelectListItem> GetAllAds() { var ads = _service.GetAllAdsList(); return(ads.Select(x => new SelectListItem { Text = x.Title + ":" + x.Version, Value = x.ID.ToString() })); }