public ActionResult Index() { var model = _LivreRepository.GetAllLivre(); return(View(model)); }
public ActionResult Index() { string id = HttpContext.Request.Query["id"]; if (id == null) { ViewBag.Livre = _LivreRepository.GetAllLivre(); } else { ViewBag.Livre = _LivreRepository.GetLivreByCategory((int)Int64.Parse(id)); } ViewBag.Category = _CategoryRepository.GetAllCategory(); return(View()); }