コード例 #1
0
        // GET: SpaceShip
        public ActionResult Index()
        {
            var service = new SpaceShipService();
            var model   = service.GetAllSpaceShips();

            return(View(model));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        // 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));
        }