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)); }
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)); } }
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)); //} }
// 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()); } }
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); }