示例#1
0
        // GET: Category
        public ActionResult Categories()
        {
            using (var ef = new LibraryEntities())
            {
                lstCategories = ef.GetAllCategory().ToList();
            }

            lstCategories = lstCategories.OrderBy(o => o.idCategory).ToList();

            return(View(lstCategories));
        }
示例#2
0
        public ActionResult NewBook()
        {
            var library = new Models.Library();

            using (var ef = new LibraryEntities())
            {
                library.lstCategories = ef.GetAllCategory().ToList();
            }

            return(View(library));
        }