public ActionResult EditForm(int?id) { var obj = new ProductDistributorItem(); var listProductType = distributorRepository.GetListForTree <object>(); if (id.HasValue) { obj = distributorRepository.GetItemById <ProductDistributorItem>(id.Value); } return(Json(new { data = obj, listType = listProductType }, JsonRequestBehavior.AllowGet)); }