Example #1
0
        public IActionResult Detail(string id)
        {
            //get the film with the corresponding id and show the details
            IStarWarsDAO dao  = new MockStarWarsDAO();
            var          film = dao.GetFilm(id);

            return(View("Detail", film));
        }
        public IActionResult Detail(string id)
        {
            // Find the film with the given id and display it in the default view
            IStarWarsDAO dao = new MockStarWarsDAO();

            // TODO: Change this DAO to a SQL DAO to get the "production" data

            Film film = dao.GetFilm(id);

            return(View(film));
        }
Example #3
0
        public IActionResult Details(string id)
        {
            // Create a DAO to access the "database"
            MockStarWarsDAO dao = new MockStarWarsDAO();

            // Call the mthod to get a single film
            Film film = dao.GetFilm(id);

            // Pass the film into the Details view
            return(View(film));
        }
        public IActionResult Detail(string id)
        {
            IStarWarsDAO dao  = new MockStarWarsDAO();
            Film         film = dao.GetFilm(id);

            if (film == null)
            {
                return(NotFound());
            }
            else
            {
                return(View(film));
            }
        }
Example #5
0
        public IActionResult Detail(string id)
        {
            // Find the film with the given id and display it in the default view
            IStarWarsDAO dao  = new MockStarWarsDAO();
            Film         film = dao.GetFilm(id);

            //if (film == null)
            //{
            //    return NotFound();
            //}
            //else
            //{
            return(View(film));
            //}
        }
Example #6
0
        // parameter name must match what's in startup.cs
        public IActionResult Detail(string movie_id)
        {
            IStarWarsDAO dao = new MockStarWarsDAO();

            if (!String.IsNullOrEmpty(movie_id))
            {
                Film movie = dao.GetFilm(movie_id);
                if (movie == null)
                {
                    return(NotFound());
                }
                return(View(movie));
            }
            else
            {
                return(NotFound());
            }
        }
Example #7
0
        public IActionResult Detail(string id)
        {
            IActionResult result = null;

            Film film = null;

            if (id != null)
            {
                var db = new MockStarWarsDAO();
                film   = db.GetFilm(id);
                result = View(film);
            }
            else
            {
                result = View("Error");
            }

            return(result);
        }