// GET: SpaceShip public ActionResult Index() { var service = new SpaceShipService(); var model = service.GetAllSpaceShips(); return(View(model)); }
public ActionResult ShipOrigin(int?LaunchSiteId) { var service = new SpaceShipService(); var ships = service.GetAllSpaceShips(); var shipOrigin = (from s in ships where (LaunchSiteId == null || s.LaunchSiteId == LaunchSiteId) select s).ToList(); return(View(shipOrigin)); }
// GET: SpaceShip public ActionResult Index(string searchString) { var service = new SpaceShipService(); var model = service.GetAllSpaceShips(); if (!String.IsNullOrEmpty(searchString)) { model = model.Where(s => s.ShipName.Contains(searchString)).ToList(); } return(View(model)); }