public ActionResult Edit(int id) { NewsVM vm = new NewsVM(); List <News> lista = vm.Get_list(); News a = lista.Where(s => s.NewsID == id).FirstOrDefault(); return(View(a)); }
// GET: News public ActionResult Index() { NewsVM vm = new NewsVM(); List <News> list_news = vm.Get_list().ToList(); ViewBag.News = list_news; return(View(list_news)); }
// GET: Home public ActionResult Index() { NewsVM vm = new NewsVM(); List <News> list_news = vm.Get_list().ToList(); list_news.Reverse(); ViewBag.News = list_news.Take(3); //----- AccountVM userBL = new AccountVM(); List <Account> list = userBL.Get_list(); return(View(list)); }