public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Catagory catagoryValue = _manager.GetById((int)id); ViewBag.CategoryId = new SelectList(_manager.GetAll(), "Id", "Name", catagoryValue.CategoryId); return(View(catagoryValue)); }
//customer/edit/id public IActionResult Edit(int?id) { if (id != null && id > 0) { Catagory existingCatagory = _catagoryManager.GetById(id); if (existingCatagory != null) { return(View(existingCatagory)); } } return(View()); }