public ActionResult List(string key = "") { var result = BookRepo.GetAll(key); if (TempData["Error"] != null) { ViewBag.Error = TempData["Error"]; } return(View(result)); }
public ActionResult Index(int?id) { if (id.HasValue) { var result = BookRepo.GetAll((int)id); return(View(result)); } else { var result = BookRepo.GetAll(); return(View(result)); } }