// GET: Advertisements/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Advertisement advertisement = _repo.GetAdvertisement(id); if (advertisement == null) { return(HttpNotFound()); } return(View(advertisement)); }
//AdvertisementRepo repo = new AdvertisementRepo(); // GET: Advertisement public ActionResult Index() { var advertisement = _repo.GetAdvertisement(); return(View(advertisement)); }