// GET: Admin/MainCategory public virtual ActionResult Index() { ViewBag.list = _mainCategory.GetAll(); var list = _mainCategory.GetAll().Where(c => c.ParentId == null); return(View(list)); }
public virtual ActionResult Create() { ViewBag.MainCategoryId = new SelectList(_mainCategory.GetAll().Where(c => c.MarkAsDelete != true), "MainCategoryId", "Name"); ViewBag.UserId = new SelectList(_usersManager.GetAllUsers(), "Id", "UserName"); return(View()); }