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));
        }
Exemple #2
0
        //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());
        }