// GET: Buildings public ActionResult Index() { IEnumerable <Building> buildings = p_repo.GetBuildings(); if (buildings == null) { return(RedirectToAction("Create")); } // Paginate buildings here, what if there are a bunch? IPagedList<T> //var buildings = p_repo.GetBuildings().ToList(); return(View(buildings)); }
// GET: Departments/Create public ActionResult Create() { ViewBag.BuildingId = new SelectList(p_repo.GetBuildings(), "Id", "Name"); return(View()); }