コード例 #1
0
ファイル: CategoryController.cs プロジェクト: AloSCX/Library
        // 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));
        }