public ActionResult MovieList() { VidlyEntities db = new VidlyEntities(); List <movie> movies = db.movies.ToList <movie>(); return(View(movies)); }
public ActionResult Details(int id) { using (VidlyEntities _contex = new VidlyEntities()) { Customer customer = _contex.Customers.SingleOrDefault(x => x.Id == id); return(View(customer)); } }
public ActionResult getCustomers() { using (VidlyEntities _contex = new VidlyEntities()) { List <Customer> customers = _contex.Customers.ToList(); return(View(customers)); } }
// GET: Movies public ActionResult Random() { using (VidlyEntities _contex = new VidlyEntities()) { Movie movie = _contex.Movies.SingleOrDefault(x => x.Id == 1); List <Customer> customers = _contex.Customers.ToList(); var randomMovieCustomer = new RandomMovieViewModel() { Movie = movie, Customers = customers }; return(View(randomMovieCustomer)); } }
public ActionResult CreateMovie(MovieModel movie) { VidlyEntities db = new VidlyEntities(); }