public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CategoryViewModel category = categoryService.getCategoryViewModel((int)id); if (category == null) { return(HttpNotFound()); } PopulateStatusDropDownList((Define.Status)category.Status); PopulateParentCategoryDropDownList(category.ParentId, id); return(View(category)); }