public ActionResult Index(FilmeIndexViewModel ViewModel) { ViewModel.Filmes = db.Filme.Where(f => f.FilmeID == (ViewModel.FilmeID ?? f.FilmeID)); ViewModel.FilmeSelectLIst = new SelectList(db.Filme, "FilmeID", "Titulo", ViewModel.FilmeID ?? ViewModel.FilmeID); ViewModel.FilmePerPage = FilmePerPageSetting; return(PartialView("_Index", ViewModel)); }
// GET: Filmes public ActionResult Index(int page = 1) { var ViewModel = new FilmeIndexViewModel { FilmePerPage = FilmePerPageSetting, Filmes = db.Filme.OrderBy(d => d.Titulo), FilmeSelectLIst = new SelectList(db.Filme, "FilmeID", "Titulo"), CurrentPage = page }; return(View(ViewModel)); }
public ActionResult Index() { var view = new FilmeIndexViewModel(); return(View(view)); }