public IActionResult Edit([Bind("AdId,AdType,AdTrafficSource,AdOS,AdTargetMarket,AdTargetCountry,ImageURL,AdVies,AdRunTime,CategoryId,AdCategory")] Ad ad) { if (ModelState.IsValid) { try { _adRepository.EditAd(ad); } catch (DbUpdateConcurrencyException) { if (!AdExists(ad.AdId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ad)); }