public JsonResult Delete(int id) { var entity = _urunlerService.Get(x => x.ID == id).Entity; if (entity != null) { Helper.DeleteFile(folderPath, entity.KapakResmi); _urunlerService.Delete(x => x.ID == id); return(Json(new { Status = "success", Message = "Silindi" })); } else { return(Json(new { Status = "error", Message = "Bir hata oluştu" })); } }
public ActionResult Delete(int id) { _urunService.Delete(id); TempData.Add("mesaj", "Ürün başarıyla silindi"); return(View("Index")); }