public ActionResult About() { ViewBag.Message = "Your application description page."; var context = new dataContext(); IEnumerable <category> list = context.Set <category>(); return(View(list.ToList())); }
public PartialViewResult Menu() { var context = new dataContext(); //List<RoleValue> roleValues = (List<RoleValue>)Session["MagentyRoleValues"]; //List<RoleValue> menuList = new List<RoleValue>(); //menuList = roleValues.Where(x => x.MenuOrAction == "M" && x.IsPermission == true).ToList(); //return PartialView("_Menu", menuList); List <category> categoryList = new List <category>(); categoryList = context.Set <category>().ToList(); //List<List<category>> orderedList = new List<List<category>>(); //foreach (var item in categoryList) //{ // List<category> itemCat = new List<category>(); // if (item.topCategoryId == 0) // { // itemCat.Add(item); // foreach (var itemList in categoryList) // { // if (item.id == itemList.topCategoryId) // { // itemCat.Add(itemList); // } // } // } // orderedList.Add(itemCat); //} return(PartialView("_Menu", categoryList)); }
public async Task <IEnumerable <Student> > GetAllAsync() { return(await _courseprDbContext.Set <Student>().ToListAsync()); }
public async Task <IEnumerable <Course> > GetAllAsync() { return(await _courseprDbContext.Set <Course>().Include(p => p.courseTime).ToListAsync()); }