public IEnumerable <tblCategory> GetCategories() { var lobjCategories = db.sp_Select_tblCategory().ToList(); foreach (var category in lobjCategories) { tblCategory lobjCategory = new tblCategory(); lobjCategory.CATEGORY_ID = category.CATEGORY_ID; lobjCategory.CATEGORY_NAME = category.CATEGORY_NAME; ilstCtegory.Add(lobjCategory); } return(ilstCtegory); }
// GET: Products/Create public ActionResult Create() { ViewBag.PROD_CATEGORY_ID = new SelectList(db.sp_Select_tblCategory().ToList(), "CATEGORY_ID", "CATEGORY_NAME"); return(View()); }
// GET: Categories public ActionResult AllCategoryList() { return(View(db.sp_Select_tblCategory().ToList())); }