public ActionResult GetAll() { ItemCategoryRepository repository = new ItemCategoryRepository(); ModelState.Clear(); return(View(repository.GetAll())); }
// GET: Item/Edit/5 public ActionResult Edit(int id) { ItemRepository repository = new ItemRepository(); ItemCategoryRepository itemCategoryRep = new ItemCategoryRepository(); ItemModel model = repository.GetById(id); model.ItemCategories = itemCategoryRep.GetAll(); return(View(model)); }
// GET: Item/Create public ActionResult Create() { ItemCategoryRepository itemCategoryRep = new ItemCategoryRepository(); ItemModel model = new ItemModel { ItemCategories = itemCategoryRep.GetAll() }; return(View(model)); }