public ActionResult Edit(Guid?id, string Name, string Description, int Product = 0, int Post = 0, HttpPostedFileBase Parvandeh = null) { try { if (Parvandeh == null) { dc.Image_Edit(id, Name, null, Description, Product, Post); } else { var _Bytes = new byte[Parvandeh.ContentLength]; Parvandeh.InputStream.Read(_Bytes, 0, Parvandeh.ContentLength); dc.Image_Edit(id, Name, _Bytes, Description, null, null); } return(RedirectToAction("Index")); } catch { ViewBag.Message = "خطا در به روز رسانی"; var image = dc.Images.Where(x => x.Id == id).Select(m => new MusicProduction.Models.Image { عکس = m.عکس, Id = m.Id, توضیحات = m.توضیحات }).FirstOrDefault(); if (Request.IsAjaxRequest()) { return(PartialView(image)); } return(View(image)); } }