// GET: Category public ActionResult Categories() { using (var ef = new LibraryEntities()) { lstCategories = ef.GetAllCategory().ToList(); } lstCategories = lstCategories.OrderBy(o => o.idCategory).ToList(); return(View(lstCategories)); }
public ActionResult NewBook() { var library = new Models.Library(); using (var ef = new LibraryEntities()) { library.lstCategories = ef.GetAllCategory().ToList(); } return(View(library)); }